Skip to content

Commit 339f22c

Browse files
committed
Limit the maximum size of the sidebar
1 parent 3e90d32 commit 339f22c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ImageViewer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ bool ImageViewer::mouseMotionEvent(const Eigen::Vector2i& p, const Eigen::Vector
332332
}
333333

334334
if (mIsDraggingSidebar) {
335-
mSidebar->setFixedWidth(max(205, p.x()));
335+
mSidebar->setFixedWidth(clamp(p.x(), 205, mSize.x() - 10));
336336
requestLayoutUpdate();
337337
} else if (mIsDraggingImage) {
338338
// If left mouse button is held, move the image with mouse movement

0 commit comments

Comments
 (0)