As suggested by Jérôme remove one level of indentation.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39745 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
d277bc8294
commit
fd5a5935a7
@ -794,37 +794,36 @@ SATWindow::_RestoreOriginalSize(bool stayBelowMouse)
|
||||
int32 buttons;
|
||||
fDesktop->GetLastMouseState(&mousePosition, &buttons);
|
||||
SATDecorator* decorator = GetDecorator();
|
||||
if (decorator) {
|
||||
BRect tabRect = decorator->TabRect();
|
||||
if (mousePosition.y < tabRect.bottom
|
||||
&& mousePosition.x <= frame.right + decorator->BorderWidth() +1
|
||||
&& mousePosition.x >= frame.left + decorator->BorderWidth()) {
|
||||
// verify mouse stays on the tab
|
||||
float deltaX = 0;
|
||||
if (tabRect.right < mousePosition.x)
|
||||
deltaX = mousePosition.x - tabRect.right + 20;
|
||||
else if (tabRect.left > mousePosition.x)
|
||||
deltaX = mousePosition.x - tabRect.left - 20;
|
||||
fDesktop->MoveWindowBy(fWindow, deltaX, 0);
|
||||
} else {
|
||||
// verify mouse stays on the border
|
||||
float deltaX = 0;
|
||||
float deltaY = 0;
|
||||
BRect newFrame = fWindow->Frame();
|
||||
if (x != 0 && mousePosition.x > frame.left
|
||||
&& mousePosition.x > newFrame.right) {
|
||||
deltaX = mousePosition.x - newFrame.right;
|
||||
if (mousePosition.x > frame.right)
|
||||
deltaX -= mousePosition.x - frame.right;
|
||||
}
|
||||
if (y != 0 && mousePosition.y > frame.top
|
||||
&& mousePosition.y > newFrame.bottom) {
|
||||
deltaY = mousePosition.y - newFrame.bottom;
|
||||
if (mousePosition.y > frame.bottom)
|
||||
deltaY -= mousePosition.y - frame.bottom;
|
||||
}
|
||||
|
||||
fDesktop->MoveWindowBy(fWindow, deltaX, deltaY);
|
||||
if (decorator == NULL)
|
||||
return;
|
||||
BRect tabRect = decorator->TabRect();
|
||||
if (mousePosition.y < tabRect.bottom
|
||||
&& mousePosition.x <= frame.right + decorator->BorderWidth() +1
|
||||
&& mousePosition.x >= frame.left + decorator->BorderWidth()) {
|
||||
// verify mouse stays on the tab
|
||||
float deltaX = 0;
|
||||
if (tabRect.right < mousePosition.x)
|
||||
deltaX = mousePosition.x - tabRect.right + 20;
|
||||
else if (tabRect.left > mousePosition.x)
|
||||
deltaX = mousePosition.x - tabRect.left - 20;
|
||||
fDesktop->MoveWindowBy(fWindow, deltaX, 0);
|
||||
} else {
|
||||
// verify mouse stays on the border
|
||||
float deltaX = 0;
|
||||
float deltaY = 0;
|
||||
BRect newFrame = fWindow->Frame();
|
||||
if (x != 0 && mousePosition.x > frame.left
|
||||
&& mousePosition.x > newFrame.right) {
|
||||
deltaX = mousePosition.x - newFrame.right;
|
||||
if (mousePosition.x > frame.right)
|
||||
deltaX -= mousePosition.x - frame.right;
|
||||
}
|
||||
if (y != 0 && mousePosition.y > frame.top
|
||||
&& mousePosition.y > newFrame.bottom) {
|
||||
deltaY = mousePosition.y - newFrame.bottom;
|
||||
if (mousePosition.y > frame.bottom)
|
||||
deltaY -= mousePosition.y - frame.bottom;
|
||||
}
|
||||
fDesktop->MoveWindowBy(fWindow, deltaX, deltaY);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user