Drag and zoom with canvas kineticjs -


i've made draggable stage kineticjs , made zoom function means of scaling canvas.

when using zoom factor, canvas zooming center of screen. after dragging canvas , using zoom function, canvas still zooming point on center @ beginning dragged aside.

what want zoom new point on center of screen after dragging.

can please explain how handle this?

thanks in advance!

you need set offset fixed point (the centre of screen) canvas knows zoom. if not, zoom towards original point.

var stage = new kinetic.stage({   container: 'container',   width: 400,   height: 300,   offset: [200, 150] //zoom towards point (200,150) }; 

also, see answers here scaling fixed point in kineticjs juan.facorro , eric rowell (kineticjs developer) more information.


Comments

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -