From cb280fa99ba99cb7058bfcf34d6293886f3a92b7 Mon Sep 17 00:00:00 2001 From: Jakub Pawlewicz Date: Thu, 12 May 2011 17:50:10 +0200 Subject: [PATCH 1/3] Fix scribble draw when a view is scrolled --- examples/Scribble/Scribble.cpp | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/Scribble/Scribble.cpp b/examples/Scribble/Scribble.cpp index b9aafa1..882116b 100644 --- a/examples/Scribble/Scribble.cpp +++ b/examples/Scribble/Scribble.cpp @@ -53,8 +53,8 @@ void Scribble::Paint(Draw& w) w.DrawRect(p1.x, p1.y, 1, 1, Black); } w.End(); - w.DrawRect(imagesize.cx - pos.x, 0, sz.cx - imagesize.cx - pos.x, sz.cy, SLtGray); - w.DrawRect(0, imagesize.cy - pos.y, imagesize.cx - pos.x, sz.cy - imagesize.cy - pos.y, SLtGray); + w.DrawRect(imagesize.cx - pos.x, 0, sz.cx - pos.x, sz.cy, SLtGray); + w.DrawRect(0, imagesize.cy - pos.y, imagesize.cx - pos.x, sz.cy - pos.y, SLtGray); w.DrawRect(-pos.x, -pos.y + imagesize.cy, imagesize.cx, 1, SBlack); w.DrawRect(-pos.x + imagesize.cx, -pos.y, 1, imagesize.cy, SBlack); } @@ -62,14 +62,14 @@ void Scribble::Paint(Draw& w) void Scribble::MouseMove(Point p, dword keyflags) { if(HasCapture()) { - image.Top().Add() = p; + image.Top().Add() = scroll + p; Refresh(); } } void Scribble::LeftDown(Point p, dword keyflags) { - image.Add().Add() = p; + image.Add().Add() = scroll + p; SetCapture(); Refresh(); } -- 1.7.4.1