From: Till Theato Date: Sat, 5 Mar 2011 19:35:24 +0000 (+0000) Subject: bezier color curves: fix some zoom issues X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=38508707bb5ad9202a265265829ff12a7f31cf09;p=kdenlive bezier color curves: fix some zoom issues svn path=/trunk/kdenlive/; revision=5476 --- diff --git a/src/beziercurve/beziersplineeditor.cpp b/src/beziercurve/beziersplineeditor.cpp index 4ef7ea12..fc5278b2 100644 --- a/src/beziercurve/beziersplineeditor.cpp +++ b/src/beziercurve/beziersplineeditor.cpp @@ -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)