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:
parent
351e8e8916
commit
9005e2fda8
2 changed files with 6 additions and 0 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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…
Add table
Add a link
Reference in a new issue