Very small label issue

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,

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.

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.

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

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