I'm not 100% sure, but I think I fixed a confusion in sending the current view position and size to the client. Note that BView::originX and BView::originY are poorly named, because they are not the local coordinate system origin, but the offset within the parent at which the view is located.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12484 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus 2005-04-27 23:20:29 +00:00
parent 50581a7c0a
commit 4828a7251f
1 changed files with 4 additions and 10 deletions

View File

@ -550,7 +550,6 @@ void ServerWindow::DispatchMessage(int32 code, LinkMsgReader &link)
_CopyBits(myRootLayer, cl, src, dst, xOffset, yOffset);
// TODO: notify the client, no?
cl->fLayerData->OffsetOrigin(BPoint(dh, dv));
//cl->fBoundsLeftTop += BPoint(dh, dv);
//cl->fFrame.OffsetBy(BPoint(-dh, -dv));
@ -729,17 +728,12 @@ void ServerWindow::DispatchMessage(int32 code, LinkMsgReader &link)
case AS_LAYER_GET_COORD:
{
STRACE(("ServerWindow %s: Message AS_LAYER_GET_COORD: Layer: %s\n",fName, cl->fName->String()));
printf("AS_LAYER_GET_COORD - Layer: %s\n", cl->GetName());
cl->fFrame.PrintToStream();
cl->BoundsOrigin().PrintToStream();
fMsgSender->StartMessage(SERVER_TRUE);
BPoint pt(cl->ConvertFromParent(cl->fFrame.LeftTop()));
fMsgSender->Attach<float>(pt.x);
fMsgSender->Attach<float>(pt.y);
// fMsgSender->Attach<float>(cl->fFrame.left);
// fMsgSender->Attach<float>(cl->fFrame.top);
// our offset in the parent -> will be originX and originY in BView
fMsgSender->Attach<float>(cl->fFrame.left);
fMsgSender->Attach<float>(cl->fFrame.top);
// convert frame to bounds
fMsgSender->Attach<BRect>(cl->fFrame.OffsetToCopy(cl->BoundsOrigin()));
// fMsgSender->Attach<BRect>(cl->ConvertFromTop(cl->fFrame.OffsetToCopy(cl->fBoundsLeftTop)));
fMsgSender->Flush();
break;