From daebd688c0978db5f5715df99f5602fd0fbba70d Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 3 Sep 2017 01:36:17 +0300 Subject: Fix scrolling in scroll areas. --- src/gui/widgets/scrollarea.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/gui') diff --git a/src/gui/widgets/scrollarea.cpp b/src/gui/widgets/scrollarea.cpp index b67ea756a..d3f6ac7e1 100644 --- a/src/gui/widgets/scrollarea.cpp +++ b/src/gui/widgets/scrollarea.cpp @@ -794,12 +794,12 @@ void ScrollArea::mousePressed(MouseEvent& event) if (y < getVerticalMarkerDimension().y) { setVerticalScrollAmount(mVScroll - - CAST_S32(getChildrenArea().height * 0.95)); + - CAST_S32(getChildrenArea().height * 0.1)); } else { setVerticalScrollAmount(mVScroll - + CAST_S32(getChildrenArea().height * 0.95)); + + CAST_S32(getChildrenArea().height * 0.1)); } event.consume(); } @@ -815,17 +815,18 @@ void ScrollArea::mousePressed(MouseEvent& event) if (x < getHorizontalMarkerDimension().x) { setHorizontalScrollAmount(mHScroll - - CAST_S32(getChildrenArea().width * 0.95)); + - CAST_S32(getChildrenArea().width * 0.1)); } else { setHorizontalScrollAmount(mHScroll - + CAST_S32(getChildrenArea().width * 0.95)); + + CAST_S32(getChildrenArea().width * 0.1)); } event.consume(); } - if (event.getButton() == MouseButton::LEFT) + if (event.getButton() == MouseButton::LEFT && + !event.isConsumed()) { mClickX = event.getX(); mClickY = event.getY(); -- cgit v1.2.3-60-g2f50