* 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
This commit is contained in:
@@ -515,12 +515,14 @@ draw_picture(View* view, BPoint where, int32 token)
|
|||||||
ServerPicture* picture
|
ServerPicture* picture
|
||||||
= view->Window()->ServerWindow()->App()->GetPicture(token);
|
= view->Window()->ServerWindow()->App()->GetPicture(token);
|
||||||
if (picture != NULL) {
|
if (picture != NULL) {
|
||||||
BPoint origin = view->DrawingOrigin();
|
view->PushState();
|
||||||
view->SetDrawingOrigin(where);
|
view->SetDrawingOrigin(where);
|
||||||
|
|
||||||
view->PushState();
|
view->PushState();
|
||||||
picture->Play(view);
|
picture->Play(view);
|
||||||
view->PopState();
|
view->PopState();
|
||||||
view->SetDrawingOrigin(origin);
|
|
||||||
|
view->PopState();
|
||||||
picture->ReleaseReference();
|
picture->ReleaseReference();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2783,17 +2783,14 @@ ServerWindow::_DispatchViewDrawingMessage(int32 code,
|
|||||||
if (link.Read<BPoint>(&where) == B_OK) {
|
if (link.Read<BPoint>(&where) == B_OK) {
|
||||||
ServerPicture* picture = App()->GetPicture(token);
|
ServerPicture* picture = App()->GetPicture(token);
|
||||||
if (picture != NULL) {
|
if (picture != NULL) {
|
||||||
// Setting the drawing origin outside of the
|
fCurrentView->PushState();
|
||||||
// state makes sure that everything the picture
|
|
||||||
// does is relative to the global picture offset.
|
|
||||||
BPoint origin = fCurrentView->DrawingOrigin();
|
|
||||||
fCurrentView->SetDrawingOrigin(where);
|
fCurrentView->SetDrawingOrigin(where);
|
||||||
|
|
||||||
fCurrentView->PushState();
|
fCurrentView->PushState();
|
||||||
picture->Play(fCurrentView);
|
picture->Play(fCurrentView);
|
||||||
fCurrentView->PopState();
|
fCurrentView->PopState();
|
||||||
|
|
||||||
fCurrentView->SetDrawingOrigin(origin);
|
fCurrentView->PopState();
|
||||||
|
|
||||||
picture->ReleaseReference();
|
picture->ReleaseReference();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user