3 Replies Latest reply on Aug 27, 2009 8:44 AM by dan_hin

    using stage.drawrect to zoom and pan

    e_tienne Level 1
      Hi,
      I have to let the user zoom in and pan in the stage to manipulate graphics (it should work basically like Photoshop zoom and hand tools). I use the drawrect property. To zoom in and out, no problem, it works perfectly.
      But when I try to pan into the zoomed stage, I get a very jerky scrolling. When I display the mouse coordinates Director shows unstable values, even if I don't move the mouse :
      -- point(596, 305)
      -- point(596, 304)
      -- point(596, 305)
      -- point(596, 304)
      -- point(596, 305)
      -- point(596, 304)
      there is a difference of 1px but since I have a zoom in the stage I have to multiply the mouse coordinates by a zoom factor and I can have a difference of 20 px...
      Is there a way to obtain a static coordinate ? I understand that the mouseloc depends on the stage drawrect... if I change the drawrect then there is a problem, but how can I avoid this ?

      thanks
      Etienne