Very small label issue


#1

Hi Jules,

I was wondering if there could be a way to remove the default border that you use around label.

According to Label::paint code below, you always have 3 pixels in x of border and 1 in y.

g.drawFittedText (text, 3, 1, getWidth() - 6, getHeight() - 2, justification, jmax (1, (int) (getHeight() / font.getHeight())));

For very small label like a “-” to delimit some range, I would like to be able to set this border without inheriting label.

Something like

void setVerticalMargin(uint vmargin); void setHorizontalMargin(uint hmargin);

Thanks,


#2

That does seem a bit fixed. Probably a good idea would be for me not to inset the text at all if the border is transparent.


#3

that’ll break code.

I sometimes use the outline for a simple mouse over effect over labels. Applying your workaround would mean that the text would physically jump around as the user mouses over the label.


#4

Well I don’t want to break the current behavior.
It would mean that all text will grow up after the change.

Allowing to change those value is ihmo the safest move.
I don’t find disturbing that there is a small border by default… just annoying that you can’t remove it.

thx


#5

Yes, fair point. I’ll add a method to set it instead.