From ab7c7773b24f850c48ad47966a2758f47152369a Mon Sep 17 00:00:00 2001 From: Michael Pfeiffer Date: Fri, 6 Aug 2010 12:21:34 +0000 Subject: [PATCH] * With blessing from Stefano applied my alternative patch from ticket #6415: the drawing offset of a BPicture becomes the new drawing origin. * This should also close ticket #6008. * Also the Preview printer does the clipping now correctly outside the "printable rectangle". git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37939 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/servers/app/ServerPicture.cpp | 6 ++++-- src/servers/app/ServerWindow.cpp | 7 ++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/servers/app/ServerPicture.cpp b/src/servers/app/ServerPicture.cpp index ccb8b64d9a..8d41ad80bc 100644 --- a/src/servers/app/ServerPicture.cpp +++ b/src/servers/app/ServerPicture.cpp @@ -515,12 +515,14 @@ draw_picture(View* view, BPoint where, int32 token) ServerPicture* picture = view->Window()->ServerWindow()->App()->GetPicture(token); if (picture != NULL) { - BPoint origin = view->DrawingOrigin(); + view->PushState(); view->SetDrawingOrigin(where); + view->PushState(); picture->Play(view); view->PopState(); - view->SetDrawingOrigin(origin); + + view->PopState(); picture->ReleaseReference(); } } diff --git a/src/servers/app/ServerWindow.cpp b/src/servers/app/ServerWindow.cpp index dac8009c4d..b111791d48 100644 --- a/src/servers/app/ServerWindow.cpp +++ b/src/servers/app/ServerWindow.cpp @@ -2783,17 +2783,14 @@ ServerWindow::_DispatchViewDrawingMessage(int32 code, if (link.Read(&where) == B_OK) { ServerPicture* picture = App()->GetPicture(token); if (picture != NULL) { - // 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->PushState(); fCurrentView->SetDrawingOrigin(where); fCurrentView->PushState(); picture->Play(fCurrentView); fCurrentView->PopState(); - fCurrentView->SetDrawingOrigin(origin); + fCurrentView->PopState(); picture->ReleaseReference(); }