diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-11-23 16:07:49 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-11-23 16:46:25 +0100 |
commit | 439765480695975e10c92f39aa6a4cb6f2ee7646 (patch) | |
tree | 28325cbe88e82d203c6d282a235cfcc944ca980c /vcl | |
parent | 086bd3c57405ae4993be2e9100a9a7a8b85e76b2 (diff) |
vcl lok: fix scrollbar to accept mouse events in twips
Change-Id: Ieaedaa525d613f8ba55f336c613da163a09f7a33
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/control/scrbar.cxx | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/vcl/source/control/scrbar.cxx b/vcl/source/control/scrbar.cxx index 91c17b66fbf5..4ed19836e403 100644 --- a/vcl/source/control/scrbar.cxx +++ b/vcl/source/control/scrbar.cxx @@ -879,7 +879,19 @@ void ScrollBar::MouseButtonDown( const MouseEvent& rMEvt ) if (rMEvt.IsLeft() || rMEvt.IsMiddle() || rMEvt.IsRight()) { - const Point& rMousePos = rMEvt.GetPosPixel(); + Point aPosPixel; + if (!IsMapModeEnabled() && GetMapMode().GetMapUnit() == MAP_TWIP) + { + // rMEvt coordinates are in twips. + Push(PushFlags::MAPMODE); + EnableMapMode(); + MapMode aMapMode = GetMapMode(); + aMapMode.SetOrigin(Point(0, 0)); + SetMapMode(aMapMode); + aPosPixel = LogicToPixel(rMEvt.GetPosPixel()); + Pop(); + } + const Point& rMousePos = (GetMapMode().GetMapUnit() != MAP_TWIP ? rMEvt.GetPosPixel() : aPosPixel); StartTrackingFlags nTrackFlags = StartTrackingFlags::NONE; bool bHorizontal = ( GetStyle() & WB_HORZ ) != 0; bool bIsInside = false; |