[haiku-commits] r37939 - haiku/trunk/src/servers/app

Author: laplace
Date: 2010-08-06 14:21:34 +0200 (Fri, 06 Aug 2010)
New Revision: 37939
Changeset: http://dev.haiku-os.org/changeset/37939
Ticket: http://dev.haiku-os.org/ticket/6415
Ticket: http://dev.haiku-os.org/ticket/6008

Modified:
   haiku/trunk/src/servers/app/ServerPicture.cpp
   haiku/trunk/src/servers/app/ServerWindow.cpp
Log:
* 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".


Modified: haiku/trunk/src/servers/app/ServerPicture.cpp
===================================================================
--- haiku/trunk/src/servers/app/ServerPicture.cpp       2010-08-06 11:13:00 UTC 
(rev 37938)
+++ haiku/trunk/src/servers/app/ServerPicture.cpp       2010-08-06 12:21:34 UTC 
(rev 37939)
@@ -515,12 +515,14 @@
        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();
        }
 }

Modified: haiku/trunk/src/servers/app/ServerWindow.cpp
===================================================================
--- haiku/trunk/src/servers/app/ServerWindow.cpp        2010-08-06 11:13:00 UTC 
(rev 37938)
+++ haiku/trunk/src/servers/app/ServerWindow.cpp        2010-08-06 12:21:34 UTC 
(rev 37939)
@@ -2783,17 +2783,14 @@
                        if (link.Read<BPoint>(&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();
                                }


Other related posts: