How to move Path

Hello,
is there any easy way to move whole path? For example to the left?
I try to do display that will drawing in real time wave form of audio. So I need to move (slide) it in time fluently to the left with audio going. Something like osciloscope.

I tried to find such method for Path in Juce documentation, but I can’t find it.

You can use juce::Path::applyTransform()

For example moving 10px left:

Path p;

/* adding path points */

p.applyTransform(AffineTransform::translation(-10, 0));
1 Like

Thanks

For a oscilloscope display though you’d probably want a static number of points, and shift the values “leftwards” in the container. Then each time you update the display your path just draws lines in the graph that correspond to your data points