244 |
into = jarray.zeros(3, 'f') |
into = jarray.zeros(3, 'f') |
245 |
vs.coords.transformPoints3(cs, [0,0,0], into) |
vs.coords.transformPoints3(cs, [0,0,0], into) |
246 |
|
|
247 |
scale = 1./main.getFocus().getZoom() |
scale = main.getFocus().getZoom() |
248 |
|
|
249 |
# scaling |
# scaling |
250 |
nodeScale = ff.fenmm.MMGeometry.getTextScale(int(100+into[2])) |
nodeScale = ff.fenmm.MMGeometry.getTextScale(int(100+into[2])) |
265 |
|
|
266 |
|
|
267 |
class ZoomPan(vob.input.RelativeAxisListener, Action, vob.mouse.MousePressListener): |
class ZoomPan(vob.input.RelativeAxisListener, Action, vob.mouse.MousePressListener): |
|
def __init__(self, fen, context): |
|
|
Action.__init__(self, fen, context) |
|
|
self.oldZoom = 1. |
|
268 |
def pressed(self, x,y): |
def pressed(self, x,y): |
269 |
return self |
return self |
270 |
def changedRelative(self, x): |
def changedRelative(self, x): |
271 |
x = x / 2. |
self.context.main.changeZoom(x) |
272 |
main = self.context.main |
self.context.main.chgFast(self.context.oldVS, -1) |
|
f = main.getFocus() |
|
|
fX, fY = f.getPanX(), f.getPanY() |
|
|
|
|
|
dimensions = w.getSize() |
|
|
fX -= dimensions.width*(-.5/self.oldZoom + .5) |
|
|
fY -= dimensions.height*(-.5/self.oldZoom + .5) |
|
|
fX += dimensions.width*(-.5/f.zoom + .5) |
|
|
fY += dimensions.height*(-.5/f.zoom + .5) |
|
|
f.setPan(fX, fY) |
|
|
self.oldZoom = f.zoom |
|
|
|
|
|
if x: main.changeZoom(1./x) |
|
|
else: main.changeZoom(0) |
|
|
main.chgFast(self.context.oldVS, -1) |
|
|
|
|
273 |
self.context.fastMouseChg = 1 |
self.context.fastMouseChg = 1 |
|
accursed = self.context.c.getAccursed() |
|
274 |
self.context.setFastAnimation() |
self.context.setFastAnimation() |
275 |
|
|
276 |
class PanMover(Action, vob.mouse.RelativeAdapter, vob.mouse.MousePressListener): |
class PanMover(Action, vob.mouse.RelativeAdapter, vob.mouse.MousePressListener): |
277 |
def pressed(self, x,y): |
def pressed(self, x,y): |
278 |
return self |
return self |
279 |
def changedRelative(self, x,y='foo'): |
def changedRelative(self, x,y='foo'): |
280 |
main = self.context.main |
f = self.context.main.getFocus() |
|
f = main.getFocus() |
|
281 |
fX, fY = f.getPanX(), f.getPanY() |
fX, fY = f.getPanX(), f.getPanY() |
282 |
f.setPan(fX+x/f.zoom, |
f.setPan(fX-x/f.zoom, |
283 |
fY+y/f.zoom) |
fY-y/f.zoom) |
284 |
main.chgFast(self.context.oldVS, -1) |
self.context.main.chgFast(self.context.oldVS, -1) |
285 |
self.context.setFastAnimation() |
self.context.setFastAnimation() |
286 |
|
|
287 |
class MMScene: |
class MMScene: |