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:
@@ -978,7 +978,7 @@ Layer::ResizeBy(float x, float y)
|
|||||||
|
|
||||||
if(!fParent)
|
if(!fParent)
|
||||||
{
|
{
|
||||||
printf("ERROR: in Layer::MoveBy()! - No parent!\n");
|
printf("ERROR: in Layer::ResizeBy()! - No parent!\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -706,8 +706,11 @@ void ServerWindow::DispatchMessage(int32 code, LinkMsgReader &link)
|
|||||||
|
|
||||||
link.Read<float>(&x);
|
link.Read<float>(&x);
|
||||||
link.Read<float>(&y);
|
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;
|
break;
|
||||||
}
|
}
|
||||||
@@ -719,9 +722,12 @@ void ServerWindow::DispatchMessage(int32 code, LinkMsgReader &link)
|
|||||||
link.Read<float>(&newWidth);
|
link.Read<float>(&newWidth);
|
||||||
link.Read<float>(&newHeight);
|
link.Read<float>(&newHeight);
|
||||||
|
|
||||||
// TODO: Check for minimum size allowed. Need WinBorder::GetSizeLimits
|
// TODO: If cl is a window, check for minimum size allowed.
|
||||||
|
// Need WinBorder::GetSizeLimits
|
||||||
cl->ResizeBy(newWidth, newHeight);
|
float deltaWidth = newWidth - cl->fFrame.Width();
|
||||||
|
float deltaHeight = newHeight - cl->fFrame.Height();
|
||||||
|
|
||||||
|
cl->ResizeBy(deltaWidth, deltaHeight);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user