/[gzz]/gzz/gzz/modules/pp2/PPCanvasCursor.java
ViewVC logotype

Diff of /gzz/gzz/modules/pp2/PPCanvasCursor.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.18 by mudyc, Sat Feb 15 10:48:10 2003 UTC revision 1.19 by mudyc, Sat Feb 15 14:01:04 2003 UTC
# Line 187  private static final String rcsid = "$Id Line 187  private static final String rcsid = "$Id
187      // Mouse press state      // Mouse press state
188      // x, y, buttons      // x, y, buttons
189      private int [] m_state = null;      private int [] m_state = null;
190        private float m_state_zoom = -1;
191      public boolean mouse(MouseEvent e, VobScene oldVobScene) {      public boolean mouse(MouseEvent e, VobScene oldVobScene) {
192          pa("mouse e"+e+" pans: "+panx+", "+pany);          pa("mouse e"+e+" pans: "+panx+", "+pany);
193    
194          if (e.getID() == MouseEvent.MOUSE_PRESSED) {          if (e.getID() == MouseEvent.MOUSE_PRESSED) {
195              m_state = new int[]{ e.getX(), e.getY(), e.getModifiers()};              m_state = new int[]{ e.getX(), e.getY(), e.getModifiers()};
196                m_state_zoom = zoom;
197              return false;              return false;
198          }          }
199          if (m_state == null) throw new Error("Mouse state not found!");          if (m_state == null) throw new Error("Mouse state not found!");
# Line 216  private static final String rcsid = "$Id Line 218  private static final String rcsid = "$Id
218              panx = pt[0]; pany = pt[1];              panx = pt[0]; pany = pt[1];
219                            
220              current = current.h(d.contains);                current = current.h(d.contains);  
221                AbstractUpdateManager.chg();
222                return false;
223            }
224    
225            if (m_state[2] == e.BUTTON3_MASK) {
226                zoom = m_state_zoom * (float)
227                    Math.exp((m_state[0] - e.getY())/150.0);
228    
229                pa("Zoom: " + zoom);
230                AbstractUpdateManager.chg();
231                return false;
232          }          }
233    
234    
235          AbstractUpdateManager.chg();          AbstractUpdateManager.chg();
236          return false;          return false;
237      }      }
238    
239    
240        public void setZoom(float z) { zoom = z; }
241    
242      public void moveTo(float x, float y) {      public void moveTo(float x, float y) {
243          panx=x;          panx=x;
244          pany=y;          pany=y;
245      }      }
246    
247    
248  }  }
249    

Legend:
Removed from v.1.18  
changed lines
  Added in v.1.19

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26