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
This commit is contained in:
Stephan Aßmus
2005-11-09 13:28:15 +00:00
parent ba48e86927
commit f8e33ed5bd
+7 -5
View File
@@ -1651,8 +1651,9 @@ ServerWindow::_DispatchGraphicsMessage(int32 code, BPrivate::LinkReceiver &link)
link.Read<float>(&x2);
link.Read<float>(&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<int32>(&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;
}