fixed BView::MoveTo() and BView::ResizeTo(), fixed typo

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12487 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus 2005-04-28 09:44:29 +00:00
parent ce956b5de7
commit 609b465638
2 changed files with 12 additions and 6 deletions

View File

@ -978,7 +978,7 @@ Layer::ResizeBy(float x, float y)
if(!fParent)
{
printf("ERROR: in Layer::MoveBy()! - No parent!\n");
printf("ERROR: in Layer::ResizeBy()! - No parent!\n");
return;
}

View File

@ -706,8 +706,11 @@ void ServerWindow::DispatchMessage(int32 code, LinkMsgReader &link)
link.Read<float>(&x);
link.Read<float>(&y);
cl->MoveBy(x, y);
float offsetX = x - cl->fFrame.left;
float offsetY = y - cl->fFrame.top;
cl->MoveBy(offsetX, offsetY);
break;
}
@ -719,9 +722,12 @@ void ServerWindow::DispatchMessage(int32 code, LinkMsgReader &link)
link.Read<float>(&newWidth);
link.Read<float>(&newHeight);
// TODO: Check for minimum size allowed. Need WinBorder::GetSizeLimits
cl->ResizeBy(newWidth, newHeight);
// TODO: If cl is a window, check for minimum size allowed.
// Need WinBorder::GetSizeLimits
float deltaWidth = newWidth - cl->fFrame.Width();
float deltaHeight = newHeight - cl->fFrame.Height();
cl->ResizeBy(deltaWidth, deltaHeight);
break;
}