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

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

This commit is contained in:
attila 2022-07-22 11:15:18 +02:00
parent 351e8e8916
commit 9005e2fda8
2 changed files with 6 additions and 0 deletions

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)

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