From e9d1494da3ecb9171e80f2e679ea4b34346924d1 Mon Sep 17 00:00:00 2001 From: Stefano Ceccherini Date: Mon, 6 Aug 2007 11:55:29 +0000 Subject: [PATCH] Nevermind Stephan, in the end I found it out. Fixed shape drawing inside a BPicture, though I'm not yet sure if I should do it there on when playing the picture... git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21836 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/servers/app/ServerWindow.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/servers/app/ServerWindow.cpp b/src/servers/app/ServerWindow.cpp index 01065b6483..df0d4ed987 100644 --- a/src/servers/app/ServerWindow.cpp +++ b/src/servers/app/ServerWindow.cpp @@ -2578,7 +2578,16 @@ ServerWindow::_DispatchPictureMessage(int32 code, BPrivate::LinkReceiver &link) if (opList != NULL && ptList != NULL && link.Read(opList, opCount * sizeof(uint32)) >= B_OK && link.Read(ptList, ptCount * sizeof(BPoint)) >= B_OK) { - + + // TODO: I'm not sure If I have to do this here (when the BPicture is + // recorded, or inside ServerPicture, when the picture is replayed. + // This might seem a bit weird, but under R5, the shapes + // are always offset by the current pen location + BPoint penLocation = fCurrentLayer->CurrentState()->PenLocation(); + for (int32 i = 0; i < ptCount; i++) { + ptList[i] += penLocation; + fCurrentLayer->ConvertToScreenForDrawing(&ptList[i]); + } const bool fill = (code == AS_FILL_SHAPE); picture->WriteDrawShape(opCount, opList, ptCount, ptList, fill); }