Make resize handle never try to resize to less than it should

Signed-off-by: falkTX <falktx@falktx.com>
This commit is contained in:
falkTX 2022-01-11 00:40:24 +00:00
parent 2b3a201a6a
commit 9d7bd1583b
No known key found for this signature in database
GPG key ID: CDBAA37ABC74FBA0
2 changed files with 7 additions and 6 deletions

2
deps/PawPaw vendored

@ -1 +1 @@
Subproject commit 3ce181e48506ef6d14b6e256af98801e58119415
Subproject commit bafa29de39d8dd755c01a1a0b853e4cf5d4fc10c

View file

@ -96,17 +96,18 @@ protected:
resizingSize += offset;
lastResizePoint = ev.pos;
// TODO min width, min height
const uint minWidth = 16;
const uint minHeight = 16;
const double scaleFactor = getScaleFactor();
const uint minWidth = 648 * scaleFactor;
const uint minHeight = 538 * scaleFactor;
if (resizingSize.getWidth() < minWidth)
resizingSize.setWidth(minWidth);
if (resizingSize.getWidth() > 16384)
else if (resizingSize.getWidth() > 16384)
resizingSize.setWidth(16384);
if (resizingSize.getHeight() < minHeight)
resizingSize.setHeight(minHeight);
if (resizingSize.getHeight() > 16384)
else if (resizingSize.getHeight() > 16384)
resizingSize.setHeight(16384);
setSize(resizingSize.getWidth(), resizingSize.getHeight());