Skip to content

Commit ac12120

Browse files
committed
Easings demo fixes.
1 parent 201072b commit ac12120

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

demo/source/demos/EasingsDemo.h

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff 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

modules/squarepine_animation/maths/CubicBezier.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)