From f8e33ed5bd87553649a93b2b06145865af534d55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Wed, 9 Nov 2005 13:28:15 +0000 Subject: [PATCH] fixed current pen position, thanks to Stefano for spotting this one, I looked very hard in the same place, but didn't see it :-) git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14787 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/servers/app/ServerWindow.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/servers/app/ServerWindow.cpp b/src/servers/app/ServerWindow.cpp index b6c44849c1..d43cca947a 100644 --- a/src/servers/app/ServerWindow.cpp +++ b/src/servers/app/ServerWindow.cpp @@ -1651,8 +1651,9 @@ ServerWindow::_DispatchGraphicsMessage(int32 code, BPrivate::LinkReceiver &link) link.Read(&x2); link.Read(&y2); - BPoint p1(x1,y1); - BPoint p2(x2,y2); + BPoint p1(x1, y1); + BPoint p2(x2, y2); + BPoint penPos = p2; fCurrentLayer->ConvertToScreen(&p1); fCurrentLayer->ConvertToScreen(&p2); driver->StrokeLine(p1, p2, fCurrentLayer->CurrentState()); @@ -1663,7 +1664,7 @@ ServerWindow::_DispatchGraphicsMessage(int32 code, BPrivate::LinkReceiver &link) // TODO: Decide where to put this, for example, it cannot be done // for DrawString(), also there needs to be a decision, if penlocation // is in View coordinates (I think it should be) or in screen coordinates. - fCurrentLayer->CurrentState()->SetPenLocation(p2); + fCurrentLayer->CurrentState()->SetPenLocation(penPos); break; } case AS_LAYER_INVERT_RECT: @@ -1928,7 +1929,8 @@ ServerWindow::_DispatchGraphicsMessage(int32 code, BPrivate::LinkReceiver &link) link.Read(&linecount); if (linecount > 0) { - LineArrayData linedata[linecount], *index; + LineArrayData linedata[linecount]; + LineArrayData* index; for (int32 i = 0; i < linecount; i++) { index = &linedata[i]; @@ -1942,7 +1944,7 @@ ServerWindow::_DispatchGraphicsMessage(int32 code, BPrivate::LinkReceiver &link) fCurrentLayer->ConvertToScreen(&index->pt1); fCurrentLayer->ConvertToScreen(&index->pt2); } - driver->StrokeLineArray(linecount,linedata,fCurrentLayer->CurrentState()); + driver->StrokeLineArray(linecount, linedata, fCurrentLayer->CurrentState()); } break; }