1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Added an assertion to Label to help catch some 'doh!' moments

This commit is contained in:
jules 2018-07-09 15:11:15 +01:00
parent 49df6e2696
commit 47535718dc

View file

@ -131,16 +131,17 @@ void Label::setBorderSize (BorderSize<int> newBorder)
//==============================================================================
Component* Label::getAttachedComponent() const
{
return static_cast<Component*> (ownerComponent);
return ownerComponent.get();
}
void Label::attachToComponent (Component* owner, bool onLeft)
{
jassert (owner != this); // Not a great idea to try to attach it to itself!
if (ownerComponent != nullptr)
ownerComponent->removeComponentListener (this);
ownerComponent = owner;
leftOfOwnerComp = onLeft;
if (ownerComponent != nullptr)