From 3e711c79d843434e9f606baf43c68b372b8aaf46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Tue, 25 May 2010 10:45:04 +0000 Subject: [PATCH] Patch mostly by jackburton: The global offset for drawing a BPicture needs to be applied before pushing a drawing state, otherwise it is not preserved throughout playing the picture data. I've added the comment and resetting the drawing origin to the previous value. Fixes ticket #6070, thanks! git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36933 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/servers/app/ServerWindow.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/servers/app/ServerWindow.cpp b/src/servers/app/ServerWindow.cpp index da2732222a..5cbe655972 100644 --- a/src/servers/app/ServerWindow.cpp +++ b/src/servers/app/ServerWindow.cpp @@ -2789,13 +2789,18 @@ ServerWindow::_DispatchViewDrawingMessage(int32 code, if (link.Read(&where) == B_OK) { ServerPicture* picture = App()->GetPicture(token); if (picture != NULL) { - fCurrentView->PushState(); - + // Setting the drawing origin outside of the + // state makes sure that everything the picture + // does is relative to the global picture offset. + BPoint origin = fCurrentView->DrawingOrigin(); fCurrentView->SetDrawingOrigin(where); - picture->Play(fCurrentView); + fCurrentView->PushState(); + picture->Play(fCurrentView); fCurrentView->PopState(); + fCurrentView->SetDrawingOrigin(origin); + picture->ReleaseReference(); } }