Diff of /trunk/previewField.cpp [r44] .. [r45] Maximize Restore

  Switch to side-by-side view

--- a/trunk/previewField.cpp
+++ b/trunk/previewField.cpp
@@ -31,9 +31,9 @@
     selectX = 0.0;
     selectY = 0.0;
     previewCalculated = false;
-    zoom = 5.0;
-    selectW = preWidth/zoom;
-    selectH = preHeight/zoom;
+    zoomX = zoomY = 5.0;
+    selectW = preWidth/zoomX;
+    selectH = preHeight/zoomY;
 
     srcImage = QImage( 200, 200, QImage::Format_ARGB32 );
     srcImage.fill( qRgb(0,0,255) );
@@ -44,11 +44,12 @@
 PreviewField::~PreviewField( void ) {
 }
 
-void PreviewField::setZoom( float newZoom ) {
+void PreviewField::setZoom( float newZoomX, float newZoomY ) {
     previewCalculated = false;
-    zoom = newZoom;
-    selectW = preWidth/zoom;
-    selectH = preHeight/zoom;
+    zoomX = newZoomX;
+    zoomY = newZoomY;
+    selectW = preWidth/zoomX;
+    selectH = preHeight/zoomY;
     update();
 }
 
@@ -112,7 +113,7 @@
         x1 = baseClipX1;
     if( y1 > baseClipY1 )
         y1 = baseClipY1;
-   return QRect( int( x0*zoom ), int( y0*zoom ), int((x1-x0)*zoom), int((y1-y0)*zoom) );
+   return QRect( int( x0*zoomX ), int( y0*zoomY ), int((x1-x0)*zoomX), int((y1-y0)*zoomY) );
 }
 
 void PreviewField::mousePressEvent( QMouseEvent *event ) {
@@ -128,8 +129,8 @@
 void PreviewField::mouseMoveEvent( QMouseEvent *event ) {
     if( event->buttons() & Qt::LeftButton ) {
         float dx,dy,newx,newy;
-        newx = sXGrabStart - float( event->pos().x() - mouseXGrabStart)/zoom;
-        newy = sYGrabStart - float( event->pos().y() - mouseYGrabStart)/zoom;
+        newx = sXGrabStart - float( event->pos().x() - mouseXGrabStart)/zoomX;
+        newy = sYGrabStart - float( event->pos().y() - mouseYGrabStart)/zoomY;
         moveSelection( newx, newy );
     }
 }
@@ -153,10 +154,10 @@
             sw = int( baseClipX1) - sx;
         if( sh > int( baseClipY1) - sy )
             sh = int( baseClipY1) - sy;
-        int tx = int( ( float(sx) - selectX )*zoom );
-        int ty = int( ( float(sy) - selectY )*zoom );
-        int tw = int( float(sw)*zoom );
-        int th = int( float(sh)*zoom );
+        int tx = int( ( float(sx) - selectX )*zoomX );
+        int ty = int( ( float(sy) - selectY )*zoomY );
+        int tw = int( float(sw)*zoomX );
+        int th = int( float(sh)*zoomY );
         QRect sourceR, targetR;
         sourceR = QRect( sx, sy, sw, sh );
         targetR = QRect( tx, ty, tw, th );