Subversion Repositories eFlore/Applications.cel

Rev

Rev 225 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 225 Rev 268
Line 1... Line 1...
1
package org.tela_botanica.client.vues.image;
1
package org.tela_botanica.client.vues.image;
Line -... Line 2...
-
 
2
 
2
 
3
 
3
import org.tela_botanica.client.image.ImageMediateur;
4
import org.tela_botanica.client.image.ImageMediateur;
Line -... Line 5...
-
 
5
import org.tela_botanica.client.interfaces.Rafraichissable;
4
import org.tela_botanica.client.interfaces.Rafraichissable;
6
 
5
 
7
import com.google.gwt.core.client.JavaScriptObject;
6
import com.google.gwt.user.client.Event;
8
import com.google.gwt.user.client.Event;
7
import com.google.gwt.user.client.Timer;
9
import com.google.gwt.user.client.Timer;
8
import com.google.gwt.user.client.Window;
10
import com.google.gwt.user.client.Window;
-
 
11
import com.google.gwt.user.client.ui.ClickListener;
-
 
12
import com.google.gwt.user.client.ui.Image;
9
import com.google.gwt.user.client.ui.ClickListener;
13
import com.google.gwt.user.client.ui.KeyboardListener;
-
 
14
import com.google.gwt.user.client.ui.KeyboardListenerCollection;
10
import com.google.gwt.user.client.ui.Image;
15
import com.google.gwt.user.client.ui.LoadListener;
11
import com.google.gwt.user.client.ui.LoadListener;
16
import com.google.gwt.user.client.ui.MouseListener;
-
 
17
import com.google.gwt.user.client.ui.MouseWheelListener;
12
import com.google.gwt.user.client.ui.MouseWheelListener;
18
import com.google.gwt.user.client.ui.MouseWheelVelocity;
13
import com.google.gwt.user.client.ui.MouseWheelVelocity;
19
import com.google.gwt.user.client.ui.ToggleButton;
-
 
20
import com.google.gwt.user.client.ui.Widget;
-
 
21
import com.gwtext.client.core.AnimationConfig;
14
import com.google.gwt.user.client.ui.Widget;
22
import com.gwtext.client.core.Direction;
15
import com.gwtext.client.core.AnimationConfig;
23
import com.gwtext.client.core.DomConfig;
16
import com.gwtext.client.core.EventObject;
24
import com.gwtext.client.core.EventObject;
-
 
25
import com.gwtext.client.core.Ext;
Line 17... Line 26...
17
import com.gwtext.client.core.Ext;
26
import com.gwtext.client.core.ExtElement;
18
import com.gwtext.client.core.ExtElement;
27
import com.gwtext.client.core.Function;
19
 
28
 
20
import com.gwtext.client.core.RegionPosition;
29
import com.gwtext.client.core.RegionPosition;
21
import com.gwtext.client.dd.DragData;
30
import com.gwtext.client.dd.DragData;
-
 
31
import com.gwtext.client.dd.DragSource;
-
 
32
import com.gwtext.client.dd.DropTarget;
22
import com.gwtext.client.dd.DragSource;
33
import com.gwtext.client.dd.DropTargetConfig;
23
import com.gwtext.client.dd.DropTarget;
34
import com.gwtext.client.widgets.Button;
24
import com.gwtext.client.dd.DropTargetConfig;
35
import com.gwtext.client.widgets.Component;
-
 
36
import com.gwtext.client.widgets.Container;
-
 
37
import com.gwtext.client.widgets.Panel;
-
 
38
import com.gwtext.client.widgets.ToolTip;
-
 
39
import com.gwtext.client.widgets.Toolbar;
-
 
40
import com.gwtext.client.widgets.ToolbarButton;
25
import com.gwtext.client.widgets.Container;
41
import com.gwtext.client.widgets.ToolbarTextItem;
26
import com.gwtext.client.widgets.Panel;
42
import com.gwtext.client.widgets.event.ButtonListener;
27
import com.gwtext.client.widgets.ToolTip;
43
import com.gwtext.client.widgets.event.ButtonListenerAdapter;
28
import com.gwtext.client.widgets.event.PanelListenerAdapter;
44
import com.gwtext.client.widgets.event.PanelListenerAdapter;
-
 
45
import com.gwtext.client.widgets.grid.GridDragData;
Line 29... Line 46...
29
import com.gwtext.client.widgets.grid.GridDragData;
46
import com.gwtext.client.widgets.layout.BorderLayout;
30
import com.gwtext.client.widgets.layout.BorderLayout;
47
import com.gwtext.client.widgets.layout.BorderLayoutData;
31
import com.gwtext.client.widgets.layout.BorderLayoutData;
48
import com.gwtext.client.widgets.menu.Menu;
32
 
49
 
Line 100... Line 117...
100
	/**.
117
	/**.
101
	 * boolean de gestion du double clic
118
	 * boolean de gestion du double clic
102
	 */
119
	 */
103
	private boolean enClic = false;
120
	private boolean enClic = false;
Line -... Line 121...
-
 
121
	
-
 
122
	private ToolbarButton modeZoom = null;
-
 
123
	
-
 
124
	private ToolbarTextItem valeurZoom = new ToolbarTextItem("x 1");
-
 
125
	
-
 
126
	private int sourisX = 0;
-
 
127
	
-
 
128
	private int sourisY = 0;
-
 
129
	
-
 
130
	private int sourisXFin = 0;
-
 
131
	
-
 
132
	private int sourisYFin = 0;
-
 
133
	
-
 
134
	private float niveauZoom = 1;
-
 
135
	
-
 
136
	private float pasZoom = new Float(0.1);
-
 
137
 
-
 
138
	private int maxZoom = 10;
-
 
139
	
-
 
140
	private float minZoom = new Float(0.5);
-
 
141
 
-
 
142
	protected boolean scroll = false;
104
	
143
	
105
	/**
144
	/**
106
	 * Constructeur sans argument (privé car ne doit être utilisé)
145
	 * Constructeur sans argument (privé car ne doit être utilisé)
107
	 */
146
	 */
108
	@SuppressWarnings("unused")
147
	@SuppressWarnings("unused")
Line 148... Line 187...
148
		this.setLayout(new BorderLayout());
187
		this.setLayout(new BorderLayout());
Line 149... Line 188...
149
 
188
 
150
		prev.setWidth("60px");
189
		prev.setWidth("60px");
Line -... Line 190...
-
 
190
		suiv.setWidth("60px");
-
 
191
 
-
 
192
		
-
 
193
		modeZoom = new ToolbarButton("Mode Zoom");
-
 
194
		Toolbar tb = new Toolbar();
-
 
195
		tb.addButton(modeZoom);
-
 
196
		tb.addItem(valeurZoom);
-
 
197
		
151
		suiv.setWidth("60px");
198
		//setTopToolbar(tb);
152
 
199
		
153
		this.add(prev, new BorderLayoutData(RegionPosition.WEST));
200
		this.add(prev, new BorderLayoutData(RegionPosition.WEST));
Line 154... Line 201...
154
		this.add(imageConteneur, new BorderLayoutData(RegionPosition.CENTER));
201
		this.add(imageConteneur, new BorderLayoutData(RegionPosition.CENTER));
Line 163... Line 210...
163
		configDragAndDrop() ;
210
		configDragAndDrop() ;
Line 164... Line 211...
164
 
211
 
165
		// on ajoute les listeners
212
		// on ajoute les listeners
Line 166... Line 213...
166
		ajouterListeners();
213
		ajouterListeners();
167
		
214
		
Line 168... Line 215...
168
		tp.setDismissDelay(1750);
215
		tp.setDismissDelay(1050);
Line 169... Line 216...
169
		tp.applyTo(image.getElement()) ;
216
		tp.applyTo(image.getElement()) ;
Line 179... Line 226...
179
	 *            le booleen qui dit si on doit répnadre l'évènement
226
	 *            le booleen qui dit si on doit répnadre l'évènement
180
	 */
227
	 */
181
	public void rafraichir(Object nouvelleDonnees,
228
	public void rafraichir(Object nouvelleDonnees,
182
			boolean repandreRafraichissement) {
229
			boolean repandreRafraichissement) {
Line -... Line 230...
-
 
230
 
183
 
231
		//niveauZoom = 1;
184
		// si on reçoit une string
232
		// si on reçoit une string
185
		if (nouvelleDonnees instanceof String[] && initialise
233
		if (nouvelleDonnees instanceof String[] && initialise
186
				&& conteneurInitialise) {
234
				&& conteneurInitialise) {
187
			String[] infos = (String[]) nouvelleDonnees;
235
			String[] infos = (String[]) nouvelleDonnees;
Line 236... Line 284...
236
 
284
 
237
	/**
285
	/**
238
	 * Ajoute les listeners pour la gestions d'évènement
286
	 * Ajoute les listeners pour la gestions d'évènement
239
	 */
287
	 */
-
 
288
	public void ajouterListeners() {
-
 
289
		
Line -... Line 290...
-
 
290
		modeZoom.addListener(new ButtonListenerAdapter() {
-
 
291
 
-
 
292
			public void onClick(Button button, EventObject e) {
-
 
293
				// TODO Auto-generated method stub
-
 
294
				if(modeZoom.isPressed()) {
-
 
295
					modeZoom.toggle(false);
-
 
296
				} else {
-
 
297
					modeZoom.toggle(true);
-
 
298
				}
-
 
299
			}
-
 
300
			
-
 
301
			public void onToggle(Button button, boolean pressed) {
-
 
302
				if(pressed) {
-
 
303
					scroll = true;
-
 
304
					image.addStyleName("img-curseur-depl");
-
 
305
				} else  {
-
 
306
					scroll = false;
-
 
307
					image.removeStyleName("img-curseur-depl");
-
 
308
					niveauZoom = 1;
-
 
309
					verifierEtRetaillerImage();
-
 
310
					Ext.get(image.getElement()).center(imageConteneur.getElement());
-
 
311
				}
-
 
312
			}
240
	public void ajouterListeners() {
313
		});
Line 241... Line 314...
241
 
314
		
242
		image.addLoadListener(new LoadListener() {
315
		image.addLoadListener(new LoadListener() {
243
 
316
 
Line 244... Line 317...
244
			public void onError(Widget sender) {
317
			public void onError(Widget sender) {
Line 245... Line 318...
245
				// TODO Auto-generated method stub
318
				// TODO Auto-generated method stub
246
			}
319
			}
247
 
320
 
248
			public void onLoad(Widget sender) {
321
			public void onLoad(Widget sender) {
249
				
322
				
250
				int max = Math.min(imageConteneur.getHeight(), imageConteneur.getWidth());
323
				/*int max = Math.min(imageConteneur.getHeight(), imageConteneur.getWidth());
251
				int[] tailleImage = calculerDimensions(getTailleImage(), max, max);
324
				int[] tailleImage = calculerDimensions(getTailleImage(), max, max);
252
				ExtElement imgElement = Ext.get(image.getElement());
325
				ExtElement imgElement = Ext.get(image.getElement());
253
				if(animerTransition) {
326
				if(animerTransition) {
254
					AnimationConfig a = new AnimationConfig() ;
327
					AnimationConfig a = new AnimationConfig() ;
255
					a.setDuration((float) dureeAnimation);
328
					a.setDuration((float) dureeAnimation);
256
					imgElement.setHeight(tailleImage[1], a);
329
					imgElement.setHeight(tailleImage[1], a);
-
 
330
					imgElement.setWidth(tailleImage[0], a);
-
 
331
				} else {
257
					imgElement.setWidth(tailleImage[0], a);
332
					imgElement.setHeight(tailleImage[1], false);
258
				} else {
333
					imgElement.setWidth(tailleImage[0], false);
Line 259... Line 334...
259
					imgElement.setHeight(tailleImage[1], false);
334
				}*/
Line 260... Line 335...
260
					imgElement.setWidth(tailleImage[0], false);
335
				verifierEtRetaillerImage();
Line 261... Line 336...
261
				}
336
				Ext.get(image.getElement()).center(imageConteneur.getElement());
262
				demasquerChargement();
-
 
-
 
337
				demasquerChargement();
263
			}
338
			}
264
			
339
			
265
		});
340
		});
266
		
341
		
267
		image.addClickListener(new ClickListener() {
342
		image.addClickListener(new ClickListener() {
Line 278... Line 353...
278
							
353
							
279
						};
354
						};
280
						enClic = true;
355
						enClic = true;
281
						t.schedule(800);
356
						t.schedule(800);
-
 
357
					}
282
					}
358
				}
Line 283... Line 359...
283
			}
359
			}
Line 284... Line 360...
284
			
360
			
Line 285... Line 361...
285
		});
361
		});
Line 286... Line 362...
286
		
362
		
-
 
363
		image.addMouseWheelListener(new MouseWheelListener() {
-
 
364
 
-
 
365
			public void onMouseWheel(Widget sender, MouseWheelVelocity velocity) {
287
		image.addMouseWheelListener(new MouseWheelListener() {
366
				
-
 
367
				if(velocity.getDeltaY() > 0) {
288
 
368
					if(scroll) {
-
 
369
						zoomOut();
-
 
370
					} else {
-
 
371
						suiv.click();
289
			public void onMouseWheel(Widget sender, MouseWheelVelocity velocity) {
372
					}
-
 
373
				} else {
-
 
374
					if(scroll) {
-
 
375
						zoomIn();
-
 
376
					} else {
-
 
377
						prev.click();
-
 
378
					}
-
 
379
				}
-
 
380
			}
-
 
381
			
-
 
382
		});
-
 
383
		
-
 
384
		image.addMouseListener(new MouseListener() {
-
 
385
 
-
 
386
			public void onMouseDown(Widget sender, int x, int y) {
-
 
387
				if(scroll) {
-
 
388
					Event.getCurrentEvent().preventDefault();
-
 
389
					scroll = true;
-
 
390
					sourisX = x;
-
 
391
					sourisY = y;
-
 
392
					image.addStyleName("img-curseur-depl");
-
 
393
				}
-
 
394
			}
-
 
395
 
-
 
396
			public void onMouseEnter(Widget sender) {
-
 
397
				// TODO Auto-generated method stub
-
 
398
				
-
 
399
			}
-
 
400
 
-
 
401
			public void onMouseLeave(Widget sender) {
-
 
402
				// TODO Auto-generated method stub
-
 
403
				
-
 
404
			}
-
 
405
 
-
 
406
			public void onMouseMove(Widget sender, int x, int y) {
-
 
407
				
-
 
408
				sourisXFin = x;
-
 
409
				sourisYFin = y;
-
 
410
				Event.getCurrentEvent().preventDefault();
-
 
411
			}
-
 
412
 
-
 
413
			public void onMouseUp(Widget sender, int x, int y) {
-
 
414
				
-
 
415
				if(scroll) {
-
 
416
					Event.getCurrentEvent().preventDefault();
-
 
417
					
-
 
418
					if(sourisX - sourisXFin > 0) {
-
 
419
						Ext.get(image.getElement()).move(Direction.LEFT, sourisX - sourisXFin, false);
-
 
420
					}
-
 
421
					
-
 
422
					if(sourisXFin - sourisX > 0) {
-
 
423
						Ext.get(image.getElement()).move(Direction.RIGHT, sourisXFin - sourisX, false);
-
 
424
					}
-
 
425
					
-
 
426
					if(sourisY - sourisYFin > 0) {
-
 
427
						Ext.get(image.getElement()).move(Direction.UP, sourisY - sourisYFin, false);
290
				
428
					}
291
				if(velocity.getDeltaY() > 0) {
429
					
Line 292... Line 430...
292
					suiv.click();
430
					if(sourisYFin - sourisY > 0) {
Line 355... Line 493...
355
			// on ne fait rien
493
			// on ne fait rien
356
			return;
494
			return;
357
		}
495
		}
Line 358... Line 496...
358
 
496
 
359
		// on prend la taille originale de l'image
497
		// on prend la taille originale de l'image
360
		int originalX = getTailleImage()[0];
498
		/*int originalX = getTailleImage()[0];
Line 361... Line 499...
361
		int originalY = getTailleImage()[1];
499
		int originalY = getTailleImage()[1];
362
 
500
 
363
		// on la transforme en float (la division entre entier donne de curieux
501
		// on la transforme en float (la division entre entier donne de curieux
Line 372... Line 510...
372
		int nouvelleTailleX = originalX;
510
		int nouvelleTailleX = originalX;
373
		int nouvelleTailleY = originalY;
511
		int nouvelleTailleY = originalY;
Line 374... Line 512...
374
 
512
 
375
		// on prend la taille du conteneur
513
		// on prend la taille du conteneur
376
		int tailleConteneurX = imageConteneur.getWidth();
514
		int tailleConteneurX = imageConteneur.getWidth();
Line 377... Line 515...
377
		int tailleConteneurY = imageConteneur.getHeight();
515
		int tailleConteneurY = imageConteneur.getHeight();*/
378
 
516
 
379
		// si celle-ci est égale à 0 (conteneur mal initialisé)
517
		// si celle-ci est égale à 0 (conteneur mal initialisé)
380
		/*
518
		/*
381
		 * if(imageConteneur.getHeight() == 0 && tailleConteneurX == 0) { // on
519
		 * if(imageConteneur.getHeight() == 0 && tailleConteneurX == 0) { // on
382
		 * essaie de la calculer en fonction de la taille du parent et des
520
		 * essaie de la calculer en fonction de la taille du parent et des
383
		 * frères tailleConteneurY = this.getHeight() ; tailleConteneurX =
521
		 * frères tailleConteneurY = this.getHeight() ; tailleConteneurX =
384
		 * this.getWidth() - prev.getOffsetWidth() * 2 ;
522
		 * this.getWidth() - prev.getOffsetWidth() * 2 ;
385
		 *  }
523
		 *  }
386
		 */
524
		 */
387
 
525
/*
388
		// si l'image ne rentre pas telle quelle (longueur ou hauteur trop
526
		// si l'image ne rentre pas telle quelle (longueur ou hauteur trop
389
		// grande)
527
		// grande)
390
		if (originalY > tailleConteneurY || originalX > tailleConteneurX) {
528
		if (originalY > tailleConteneurY || originalX > tailleConteneurX) {
Line 403... Line 541...
403
				nouvelleTailleY = tailleConteneurY;
541
				nouvelleTailleY = tailleConteneurY;
404
				nouvelleTailleX = (int) Math.floor(nouvelleTailleY
542
				nouvelleTailleX = (int) Math.floor(nouvelleTailleY
405
						* rapportTaille);
543
						* rapportTaille);
406
			}
544
			}
407
		}
545
		}
408
 
546
*/
409
		// on modifie enfin la taille de l'image pour qu'elle soit affichée
547
		// on modifie enfin la taille de l'image pour qu'elle soit affichée
-
 
548
		int max = Math.min(imageConteneur.getHeight(), imageConteneur.getWidth());
-
 
549
		
-
 
550
		int[] tailleImage = new int[2];
-
 
551
		ExtElement imgElement = Ext.get(image.getElement());
-
 
552
		
-
 
553
		if(max == imageConteneur.getHeight()) {
410
		getImage().setSize("" + nouvelleTailleX + "px",
554
			//tailleImage[0] = getTailleImage()[0];
-
 
555
			//tailleImage[1] = max;
-
 
556
			imgElement.setHeight(max, false);
-
 
557
		} else {
-
 
558
			//tailleImage[1] = getTailleImage()[0];
411
				"" + nouvelleTailleY + "px");
559
			//tailleImage[0] = max;
-
 
560
			imgElement.setWidth(max, false);
-
 
561
		}
-
 
562
		
-
 
563
		//int[] tailleImage = calculerDimensions(getTailleImage(), max, max);
-
 
564
		//imgElement.
-
 
565
		/*if(animerTransition) {
-
 
566
			AnimationConfig a = new AnimationConfig() ;
-
 
567
			a.setDuration((float) dureeAnimation);
-
 
568
			imgElement.setHeight(tailleImage[1], a);
-
 
569
			imgElement.setWidth(tailleImage[0], a);
-
 
570
		} else {
-
 
571
			imgElement.setHeight(tailleImage[1], false);
-
 
572
			imgElement.setWidth(tailleImage[0], false);
-
 
573
		}*/
-
 
574
		
-
 
575
		String strZoom = ""+niveauZoom+"";
-
 
576
		strZoom = strZoom.substring(0,3);
-
 
577
		
-
 
578
		valeurZoom.setText("x "+strZoom);
412
	}
579
	}
Line 413... Line 580...
413
	
580
	
Line 414... Line 581...
414
	public int[] calculerDimensions(int[] tailleXY, double tailleMax, double tailleConteneur) {
581
	public int[] calculerDimensions(int[] tailleXY, double tailleMax, double tailleConteneur) {
Line 426... Line 593...
426
            float rapport = tailleXYf[0]/tailleXYf[1] ;
593
            float rapport = tailleXYf[0]/tailleXYf[1] ;
427
            XYresize[1] = tailleOr ;
594
            XYresize[1] = tailleOr ;
428
            XYresize[0] = tailleOr*rapport ;
595
            XYresize[0] = tailleOr*rapport ;
429
        }
596
        }
Line 430... Line 597...
430
        
597
        
Line 431... Line 598...
431
        int[] res = {Math.round(XYresize[0]),Math.round(XYresize[1])} ;
598
        int[] res = {(int)Math.round(XYresize[0]*niveauZoom),(int) Math.round(XYresize[1]*niveauZoom)} ;
432
        
599
        
Line 433... Line 600...
433
        return res;
600
        return res;
Line 548... Line 715...
548
	public Panel getImageConteneur() {
715
	public Panel getImageConteneur() {
Line 549... Line 716...
549
 
716
 
Line 550... Line 717...
550
		return imageConteneur;
717
		return imageConteneur;
-
 
718
 
-
 
719
	}
-
 
720
	
-
 
721
	private void zoomOut() {
-
 
722
		if(niveauZoom >= minZoom) {
-
 
723
			niveauZoom -= pasZoom;
-
 
724
			if(niveauZoom <= minZoom) {
-
 
725
				niveauZoom = minZoom;
-
 
726
			}
-
 
727
			verifierEtRetaillerImage();
-
 
728
			gererDecalage(false);
-
 
729
		}
-
 
730
	}
-
 
731
 
-
 
732
	private void zoomIn() {
-
 
733
		if(niveauZoom < maxZoom ) { 
-
 
734
			niveauZoom += pasZoom;
-
 
735
			if(niveauZoom >= maxZoom) {
-
 
736
				niveauZoom = maxZoom;
-
 
737
			}
-
 
738
			verifierEtRetaillerImage();
-
 
739
			gererDecalage(true);
-
 
740
		}
-
 
741
	}
-
 
742
	
-
 
743
	private void gererDecalage(boolean in) {
-
 
744
		
-
 
745
		float nZoom = niveauZoom;
-
 
746
		
-
 
747
		if(niveauZoom < 1) {
-
 
748
			nZoom = 1/niveauZoom;
-
 
749
		}
-
 
750
		
-
 
751
		if(!in) {
-
 
752
			int diffX = imageConteneur.getWidth()/2 - sourisX;
-
 
753
			int diffY = imageConteneur.getHeight()/2 - sourisY;
-
 
754
			
-
 
755
			if(diffX > 0) {
-
 
756
				Ext.get(image.getElement()).move(Direction.RIGHT, (int)((diffX/maxZoom)/nZoom), false);
-
 
757
			}
-
 
758
			
-
 
759
			if(-diffX > 0) {
-
 
760
				Ext.get(image.getElement()).move(Direction.LEFT, (int)(-(diffX/maxZoom)/nZoom), false);
-
 
761
			}
-
 
762
			
-
 
763
			if(diffY > 0) {
-
 
764
				Ext.get(image.getElement()).move(Direction.DOWN, (int)((diffY/maxZoom)/nZoom), false);
-
 
765
			}
-
 
766
			
-
 
767
			if(-diffY > 0) {
-
 
768
				Ext.get(image.getElement()).move(Direction.UP, (int)(-(diffY/maxZoom)/nZoom), false);
-
 
769
			}
-
 
770
		} else {
-
 
771
			int diffX = imageConteneur.getWidth()/2;
-
 
772
			int diffY = imageConteneur.getHeight()/2;
-
 
773
			if(diffX > 0) {
-
 
774
				Ext.get(image.getElement()).move(Direction.LEFT, (int)((diffX/maxZoom)/nZoom), false);
-
 
775
			}
-
 
776
			
-
 
777
			if(-diffX > 0) {
-
 
778
				Ext.get(image.getElement()).move(Direction.RIGHT, (int)((-diffX/maxZoom)/nZoom), false);
-
 
779
			}
-
 
780
			
-
 
781
			if(diffY > 0) {
-
 
782
				Ext.get(image.getElement()).move(Direction.UP, (int)((diffY/maxZoom)/nZoom), false);
-
 
783
			}
-
 
784
			
-
 
785
			if(-diffY > 0) {
-
 
786
				Ext.get(image.getElement()).move(Direction.DOWN, (int)(-(diffY/maxZoom)/nZoom), false);
-
 
787
			}
551
 
788
		}