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
94
94
{
95
95
scalablePlot = *plot;
96
96
97
+ const auto bf = b.toFloat ();
98
+
97
99
// 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
+
101
107
scalablePlot.applyTransform (plotTransform);
102
108
}
103
109
else
Original file line number Diff line number Diff line change @@ -90,9 +90,6 @@ class CubicBezier final
90
90
getP3 ().toFloat ());
91
91
// plot.closeSubPath(); // NB: Deliberately not closing for the sake of a singular line.
92
92
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
-
96
93
return path;
97
94
}
98
95
You can’t perform that action at this time.
0 commit comments