Browse Source

Drawable: Fix clobbering Component transform when setDrawableTransform() isn't called

v7.0.9
attila 3 years ago
parent
commit
9005e2fda8
2 changed files with 6 additions and 0 deletions
  1. +3
    -0
      modules/juce_gui_basics/drawables/juce_Drawable.cpp
  2. +3
    -0
      modules/juce_gui_basics/drawables/juce_Drawable.h

+ 3
- 0
modules/juce_gui_basics/drawables/juce_Drawable.cpp View File

@@ -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)


+ 3
- 0
modules/juce_gui_basics/drawables/juce_Drawable.h View File

@@ -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);


Loading…
Cancel
Save