diff --git a/modules/juce_gui_basics/drawables/juce_Drawable.cpp b/modules/juce_gui_basics/drawables/juce_Drawable.cpp index 1a902e6a5d..0c5a3cc4d7 100644 --- a/modules/juce_gui_basics/drawables/juce_Drawable.cpp +++ b/modules/juce_gui_basics/drawables/juce_Drawable.cpp @@ -163,6 +163,9 @@ void Drawable::setDrawableTransform (const AffineTransform& transform) void Drawable::updateTransform() { + if (drawableTransform.isIdentity()) + return; + const auto transformationOrigin = originRelativeToComponent + getPosition(); setTransform (AffineTransform::translation (transformationOrigin * (-1)) .followedBy (drawableTransform) diff --git a/modules/juce_gui_basics/drawables/juce_Drawable.h b/modules/juce_gui_basics/drawables/juce_Drawable.h index 566c59be1a..6d3ca08184 100644 --- a/modules/juce_gui_basics/drawables/juce_Drawable.h +++ b/modules/juce_gui_basics/drawables/juce_Drawable.h @@ -195,6 +195,9 @@ public: Using setDrawableTransform() will take this internal offset into account when applying the transform to the Component base. + + You can only use Drawable::setDrawableTransform() or Component::setTransform() for a given + object. Using both will lead to unpredictable behaviour. */ void setDrawableTransform (const AffineTransform& transform);