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

Ensured that any top-level component transforms are not applied twice

This commit is contained in:
hogliux 2018-05-30 17:29:56 +01:00
parent b85726a646
commit 3e327a5390

View file

@ -109,11 +109,15 @@ void ComponentPeer::handlePaint (LowLevelGraphicsContext& contextToPaintTo)
g.addTransform (component.getTransform());
auto peerBounds = getBounds();
auto componentBounds = component.getLocalBounds();
if (peerBounds.getWidth() != component.getWidth() || peerBounds.getHeight() != component.getHeight())
if (component.isTransformed())
componentBounds = componentBounds.transformedBy (component.getTransform());
if (peerBounds.getWidth() != componentBounds.getWidth() || peerBounds.getHeight() != componentBounds.getHeight())
// Tweak the scaling so that the component's integer size exactly aligns with the peer's scaled size
g.addTransform (AffineTransform::scale (peerBounds.getWidth() / (float) component.getWidth(),
peerBounds.getHeight() / (float) component.getHeight()));
g.addTransform (AffineTransform::scale (peerBounds.getWidth() / (float) componentBounds.getWidth(),
peerBounds.getHeight() / (float) componentBounds.getHeight()));
#if JUCE_ENABLE_REPAINT_DEBUGGING
#ifdef JUCE_IS_REPAINT_DEBUGGING_ACTIVE