Skip to content

Commit

Permalink
Make resize handle never try to resize to less than it should
Browse files Browse the repository at this point in the history
Signed-off-by: falkTX <[email protected]>
  • Loading branch information
falkTX committed Jan 11, 2022
1 parent 2b3a201 commit 9d7bd15
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion deps/PawPaw
11 changes: 6 additions & 5 deletions src/ResizeHandle.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,17 +96,18 @@ class ResizeHandle : public TopLevelWidget
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());
Expand Down

0 comments on commit 9d7bd15

Please sign in to comment.