[Digikam-devel] extragear/graphics/digikam/utilities/imageeditor/canvas

Gilles Caulier caulier.gilles at gmail.com
Thu Mar 22 12:38:48 GMT 2007


SVN commit 645355 by cgilles:

digiKam from trunk : bug fix with autozoom function : with my last changes about zoom management in editor, the zoom factor is computed just before to show the editor windows. The autozoom function compute the ratio value using the canvas size... and at the first time to launch editor, the size is null... result : zoom factor is infinite, duing a division calculation (i'm so surprize to not have an "div by 0" exception...)

This patch fix this problem. Normally, with autozoom, the image will be always displayed.

CCMAIL: digikam-devel at kde.org

 M  +5 -1      canvas.cpp  


--- trunk/extragear/graphics/digikam/utilities/imageeditor/canvas/canvas.cpp #645354:645355
@@ -374,6 +374,8 @@
 
 float Canvas::calcAutoZoomFactor()
 {
+    if (!d->im->imageValid()) return d->zoom;
+
     double srcWidth  = d->im->origWidth();
     double srcHeight = d->im->origHeight();
     double dstWidth  = contentsRect().width();
@@ -448,7 +450,9 @@
     }
     
     updateContentsSize();
-    viewport()->update();
+
+    // No need to repaint. its called   
+    // automatically after resize
 }
 
 void Canvas::viewportPaintEvent(QPaintEvent *e)



More information about the Digikam-devel mailing list