The Viewport class resets its view position, after a call to setBounds. Is it supposed to do that ?
I have to admit: I do not quite understand the mechanism, how the reset is done, because setBounds is not reimplemented in Viewport but inherited from component. Anyways, after a setBounds call, the viewPosition is back to (0,0). Even if it was somewhere else before.
Or maybe I am doing something wrong?
There is a workround though, which I currently use. Just remember and reapply the view position. I.e.:
Point<int> oldViewPos = myViewPort.getViewPosition(); myViewPort.setBounds(x,y, width, height); myViewPort.setViewPosition(oldViewPos);
Juce Version: 4.0.2 on Win 7 and VS 2015