From 98662fad6d88084f6408f5438c9cc548212b7f69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Mon, 3 Jul 2006 23:37:38 +0000 Subject: [PATCH] apply the changes to the viewRect with the right scale this fixes the scale bug I had git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18020 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/servers/app/drawing/Painter/Painter.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/servers/app/drawing/Painter/Painter.cpp b/src/servers/app/drawing/Painter/Painter.cpp index d2597d726e..510dab8227 100644 --- a/src/servers/app/drawing/Painter/Painter.cpp +++ b/src/servers/app/drawing/Painter/Painter.cpp @@ -1340,25 +1340,25 @@ Painter::_DrawBitmap(agg::rendering_buffer& srcBuffer, color_space format, actualBitmapRect.OffsetBy(-actualBitmapRect.left, -actualBitmapRect.top); // constrain rect to passed bitmap bounds - // and transfer the changes to the viewRect + // and transfer the changes to the viewRect with the right scale if (bitmapRect.left < actualBitmapRect.left) { float diff = actualBitmapRect.left - bitmapRect.left; - viewRect.left += diff; + viewRect.left += diff * xScale; bitmapRect.left = actualBitmapRect.left; } if (bitmapRect.top < actualBitmapRect.top) { float diff = actualBitmapRect.top - bitmapRect.top; - viewRect.top += diff; + viewRect.top += diff * yScale; bitmapRect.top = actualBitmapRect.top; } if (bitmapRect.right > actualBitmapRect.right) { float diff = bitmapRect.right - actualBitmapRect.right; - viewRect.right -= diff; + viewRect.right -= diff * xScale; bitmapRect.right = actualBitmapRect.right; } if (bitmapRect.bottom > actualBitmapRect.bottom) { float diff = bitmapRect.bottom - actualBitmapRect.bottom; - viewRect.bottom -= diff; + viewRect.bottom -= diff * yScale; bitmapRect.bottom = actualBitmapRect.bottom; }