mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-18 00:54:19 +00:00
Tweaked the Label class to take its border into account when positioning relative to a target component.
This commit is contained in:
parent
fce4188055
commit
90c88ec416
1 changed files with 3 additions and 2 deletions
|
|
@ -162,7 +162,8 @@ void Label::componentMovedOrResized (Component& component, bool /*wasMoved*/, bo
|
|||
|
||||
if (leftOfOwnerComp)
|
||||
{
|
||||
setSize (jmin (f.getStringWidth (textValue.toString()) + 8, component.getX()),
|
||||
setSize (jmin (roundToInt (f.getStringWidthFloat (textValue.toString()) + 0.5f) + getBorderSize().getLeftAndRight(),
|
||||
component.getX()),
|
||||
component.getHeight());
|
||||
|
||||
setTopRightPosition (component.getX(), component.getY());
|
||||
|
|
@ -170,7 +171,7 @@ void Label::componentMovedOrResized (Component& component, bool /*wasMoved*/, bo
|
|||
else
|
||||
{
|
||||
setSize (component.getWidth(),
|
||||
8 + roundToInt (f.getHeight()));
|
||||
getBorderSize().getTopAndBottom() + 6 + roundToInt (f.getHeight() + 0.5f));
|
||||
|
||||
setTopLeftPosition (component.getX(), component.getY() - getHeight());
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue