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

  • From: superstippi@xxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Fri, 19 Mar 2010 10:38:28 +0100 (CET)

Author: stippi
Date: 2010-03-19 10:38:28 +0100 (Fri, 19 Mar 2010)
New Revision: 35910
Changeset: http://dev.haiku-os.org/changeset/35910/haiku

Modified:
   haiku/trunk/src/servers/app/ServerPicture.cpp
Log:
Fixed double conversion from view to screen space I introduced with the previous
commit. PictureTest at least works again.


Modified: haiku/trunk/src/servers/app/ServerPicture.cpp
===================================================================
--- haiku/trunk/src/servers/app/ServerPicture.cpp       2010-03-19 07:53:30 UTC 
(rev 35909)
+++ haiku/trunk/src/servers/app/ServerPicture.cpp       2010-03-19 09:38:28 UTC 
(rev 35910)
@@ -88,9 +88,7 @@
 {
        try {
                fOpStack.push(OP_MOVETO);
-               BPoint transformed(*point);
-               fView->ConvertToScreenForDrawing(&transformed);
-               fPtStack.push(transformed);
+               fPtStack.push(*point);
        } catch (std::bad_alloc) {
                return B_NO_MEMORY;
        }
@@ -104,11 +102,8 @@
 {
        try {
                fOpStack.push(OP_LINETO | lineCount);
-               for (int32 i = 0; i < lineCount; i++) {
-                       BPoint transformed(linePts[i]);
-                       fView->ConvertToScreenForDrawing(&transformed);
-                       fPtStack.push(transformed);
-               }
+               for (int32 i = 0; i < lineCount; i++)
+                       fPtStack.push(linePts[i]);
        } catch (std::bad_alloc) {
                return B_NO_MEMORY;
        }
@@ -123,11 +118,8 @@
        bezierCount *= 3;
        try {
                fOpStack.push(OP_BEZIERTO | bezierCount);
-               for (int32 i = 0; i < bezierCount; i++) {
-                       BPoint transformed(bezierPts[i]);
-                       fView->ConvertToScreenForDrawing(&transformed);
-                       fPtStack.push(transformed);
-               }
+               for (int32 i = 0; i < bezierCount; i++)
+                       fPtStack.push(bezierPts[i]);
        } catch (std::bad_alloc) {
                return B_NO_MEMORY;
        }
@@ -155,11 +147,9 @@
 
        try {
                fOpStack.push(op | 3);
-               fPtStack.push(BPoint(rx * fView->Scale(), ry * fView->Scale()));
+               fPtStack.push(BPoint(rx, ry));
                fPtStack.push(BPoint(angle, 0));
-               BPoint transformed(point);
-               fView->ConvertToScreenForDrawing(&transformed);
-               fPtStack.push(transformed);
+               fPtStack.push(point);
        } catch (std::bad_alloc) {
                return B_NO_MEMORY;
        }
@@ -211,7 +201,7 @@
                        fPtStack.pop();
                }
 
-               BPoint offset;
+               BPoint offset(fView->CurrentState()->PenLocation());
                fView->ConvertToScreenForDrawing(&offset);
                fView->Window()->GetDrawingEngine()->DrawShape(frame, opCount,
                        opList, ptCount, ptList, filled, offset, 
fView->Scale());


Other related posts:

  • » [haiku-commits] r35910 - haiku/trunk/src/servers/app - superstippi