Hello!
I am zooming in, into specific areas in my SVG Map.. for example 3 times.
I save the zoomed-in area and the scale in LinkedLists..
So afterwoods i try to zoom out. For that i use the LinkedLists where the
"Zoom-History" is saved.
My code looks like this:
AffineTransform at = new AffineTransform();
at.scale(1.0, 1.0);
svgCanvas.setRenderingTransform(at);
if(zoomTimes.isEmpty()){
System.out.println("-> max. ZoomOUT reached!");
}else{
at.scale(zoomTimes.get(zoomcount), zoomTimes.get(zoomcount));
//zoomout zum letzten Scale
at.translate(-(xValues.get(zoomcount)), -(yValues.get
(zoomcount)));
at.concatenate(svgCanvas.getRenderingTransform());
svgCanvas.setRenderingTransform(at);
}
zoomcount is a counter, that is increased everytime i zoom in, and decreased
when i zoom out.
My Problem is, that he doesn't zoom to the right area when i zoom out the
FIRST time... but the second and the third time the backzoomed area is
right!
So i tried to find the bug, i have made printlines of the zoomed in and
zoomed out area... and there are my printlines:
Zoom it baby!...0--> x: 0y: 0 scale: 1.0
Zoom it baby!...1--> x: 375y: 119 scale: 4.4666666984558105
Zoom it baby!...2--> x: 319y: 108 scale: 15.814905088445357
Zoom OUT...2--> x: 319y: 108 scale: 15.814905088445357 ==> doesn't work
... it zoomes me out to any area i dont know ..
Zoom OUT...1--> x: 375y: 119 scale: 4.4666666984558105 ==> this works well
it zooms out to the 1. zoomed in area
Zoom OUT...0--> x: 0y: 0 scale: 1.0 ==> this works also it zooms back to the
0. zoomed in area (standard-status)
I hope anybody can help me...