mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-10-30 20:07:36 +00:00
Fixed: constraining window's to the screen did not respect a window's minSize.
Previously, when the platform window was resized, windows were moved/resized to stay within the virtual screen, but if the window had a minimum size, it was not respected. This commit ensures that if a window has a minimum size, it will always be respected.
This commit is contained in:
1 parent
42ad40d10d
commit
d751fea510
1 file changed
+3
-3
@@ -763,7 +763,7 @@ CPTexturedBackgroundWindowMask
|
||||
if (CGRectGetWidth(frame) > usableWidth)
|
||||
{
|
||||
frame.origin.x = CGRectGetMinX(usableRect);
|
||||
frame.size.width = usableWidth;
|
||||
frame.size.width = MAX(usableWidth, _minSize.width);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -782,7 +782,7 @@ CPTexturedBackgroundWindowMask
|
||||
if (CGRectGetHeight(frame) > usableHeight)
|
||||
{
|
||||
frame.origin.y = CGRectGetMinY(usableRect);
|
||||
frame.size.height = usableHeight;
|
||||
frame.size.height = MAX(usableHeight, _minSize.height);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -792,7 +792,7 @@ CPTexturedBackgroundWindowMask
|
||||
/*
|
||||
Constrain the origin of a frame such that:
|
||||
|
||||
- CPWindowMinVisibleHorizontalMargin is kept onscreen at the left/right of the window.
|
||||
- The window view's minimum resize width is kept onscreen at the left/right of the window.
|
||||
- The top of the window is kept below the top of the usable content.
|
||||
- The top of the contentView + CPWindowMinVisibleVerticalMargin is kept above the bottom of the usable content.
|
||||
*/
|
||||
|
||||
Reference in new issue
Block a user