File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed
modules/squarepine_animation/maths Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -94,10 +94,16 @@ class EasingPathDisplayComponent final : public Component
9494 {
9595 scalablePlot = *plot;
9696
97+ const auto bf = b.toFloat ();
98+
9799 // The 'ease' type graph on the right side:
98- plotTransform = AffineTransform::scale (1 .0f , 0 .75f )
99- .followedBy (AffineTransform::translation (0 .0f , 0 .2f ))
100- .followedBy (plot->getTransformToScaleToFit (b.toFloat (), true ));
100+ // NB: JUCE's drawing system is upside down/backwards, so we have to correct for that.
101+ plotTransform = AffineTransform ()
102+ .followedBy (plot->getTransformToScaleToFit (bf, true ))
103+ .followedBy (AffineTransform::scale (1 .0f , 0 .75f ))
104+ .followedBy (AffineTransform::verticalFlip (bf.getHeight () * 0 .75f ))
105+ .followedBy (AffineTransform::translation (0 .0f , bf.getHeight () / 2 .0f ));
106+
101107 scalablePlot.applyTransform (plotTransform);
102108 }
103109 else
Original file line number Diff line number Diff line change @@ -90,9 +90,6 @@ class CubicBezier final
9090 getP3 ().toFloat ());
9191 // plot.closeSubPath(); // NB: Deliberately not closing for the sake of a singular line.
9292
93- // JUCE's drawing system is upside down/backwards, so we have to correct for that.
94- path.applyTransform (AffineTransform::verticalFlip (path.getBounds ().getHeight ()));
95-
9693 return path;
9794 }
9895
You can’t perform that action at this time.
0 commit comments