Convert the BPoint to screen coordinates respecting the scale

(using ConvertToScreenForDrawing()) before drawing a BPicture, both directly
and inside another BPicture. Restore the drawing origin when drawing a nested
BPicture (like we already do when drawing it directly).
Fixes #6008.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37824 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stefano Ceccherini 2010-07-30 20:46:29 +00:00
parent 7d90a09a79
commit 568bdbf719
2 changed files with 5 additions and 2 deletions

View File

@ -4,7 +4,7 @@
*
* Authors:
* Marc Flerackers (mflerackers@androme.be)
* Stefano Ceccherini (burton666@libero.it)
* Stefano Ceccherini (stefano.ceccherini@gmail.com)
* Marcus Overhagen <marcus@overhagen.de>
*/
@ -515,11 +515,13 @@ draw_picture(View* view, BPoint where, int32 token)
ServerPicture* picture
= view->Window()->ServerWindow()->App()->GetPicture(token);
if (picture != NULL) {
BPoint origin = view->DrawingOrigin();
view->ConvertToScreenForDrawing(&where);
view->SetDrawingOrigin(where);
view->PushState();
picture->Play(view);
view->PopState();
view->SetDrawingOrigin(origin);
picture->ReleaseReference();
}
}

View File

@ -2786,6 +2786,7 @@ ServerWindow::_DispatchViewDrawingMessage(int32 code,
// state makes sure that everything the picture
// does is relative to the global picture offset.
BPoint origin = fCurrentView->DrawingOrigin();
fCurrentView->ConvertToScreenForDrawing(&where);
fCurrentView->SetDrawingOrigin(where);
fCurrentView->PushState();