]> git.sesse.net Git - kdenlive/commitdiff
bezier color curves: fix some zoom issues
authorTill Theato <root@ttill.de>
Sat, 5 Mar 2011 19:35:24 +0000 (19:35 +0000)
committerTill Theato <root@ttill.de>
Sat, 5 Mar 2011 19:35:24 +0000 (19:35 +0000)
svn path=/trunk/kdenlive/; revision=5476

src/beziercurve/beziersplineeditor.cpp

index 4ef7ea12aba79e3d7d405105837a7435a8125519..fc5278b24d69c47d1c63877ff1b5d32190cc9465 100644 (file)
@@ -128,16 +128,17 @@ void BezierSplineEditor::paintEvent(QPaintEvent* event)
      */
     int wWidth = width() - 1;
     int wHeight = height() - 1;
-    int offset = 1/8. * m_zoomLevel * (wWidth > wHeight ? wWidth : wHeight);
-    wWidth -= 2 * offset;
-    wHeight -= 2 * offset;
+    int offsetX = 1/8. * m_zoomLevel * wWidth;
+    int offsetY = 1/8. * m_zoomLevel * wHeight;
+    wWidth -= 2 * offsetX;
+    wHeight -= 2 * offsetY;
 
-    p.translate(offset, offset);
+    p.translate(offsetX, offsetY);
 
     /*
      * Background
      */
-    p.fillRect(rect().translated(-offset, -offset), palette().background());
+    p.fillRect(rect().translated(-offsetX, -offsetY), palette().background());
     if (!m_pixmap.isNull()) {
         if (m_pixmapIsDirty || !m_pixmapCache) {
             if (m_pixmapCache)