[Marble-devel] Review Request 115622: [PATCH] Fix #324862: Scale bar follows mouse.

Dennis Nienhüser earthwings at gentoo.org
Wed Feb 12 21:31:58 UTC 2014


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/115622/#review49679
-----------------------------------------------------------


Hi, can you please elaborate why this fixes the bug? I don't see the connection really. I suspect the fix has unwanted side effects (it breaks the init logic).

What I suspect to cause the bug (or one of its incarnations) is when the mouse button release event is not properly caught by the float item because the mouse has left the float item. This can happen e.g. if you move a float item to one of the sides and keep moving (mouse button pressed) the mouse out of the window. Below is a possible fix for that. That fix isn't too sane though because it results in sluggish move behavior: move a float item fast and it stops moving.

diff --git a/src/lib/marble/graphicsview/ScreenGraphicsItem.cpp b/src/lib/marble/graphicsview/ScreenGraphicsItem.cpp
index fbacad9..87dcefa 100644
--- a/src/lib/marble/graphicsview/ScreenGraphicsItem.cpp
+++ b/src/lib/marble/graphicsview/ScreenGraphicsItem.cpp
@@ -110,6 +110,11 @@ bool ScreenGraphicsItem::eventFilter( QObject *object, QEvent *e )
             || e->type() == QEvent::MouseButtonRelease )
         {
             QMouseEvent *event = static_cast<QMouseEvent*>( e );
+            if ( !contains( event->pos() ) ) {
+                p()->m_floatItemMoving = false;
+                return false;
+            }
+
             // The rect the item was painted on before. We add one pixel as antialiasing could
             // result into painting on these pixels to.
             QRectF floatItemRect = QRectF( positivePosition() - QPoint( 1, 1 ),


- Dennis Nienhüser


On Feb. 12, 2014, 12:39 p.m., Piotr Rżysko wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/115622/
> -----------------------------------------------------------
> 
> (Updated Feb. 12, 2014, 12:39 p.m.)
> 
> 
> Review request for Marble, Dennis Nienhüser and Torsten Rahn.
> 
> 
> Bugs: 324862
>     http://bugs.kde.org/show_bug.cgi?id=324862
> 
> 
> Repository: marble
> 
> 
> Description
> -------
> 
> Scale bar and Overview Map don't follow mouse now.
> 
> 
> Diffs
> -----
> 
>   src/plugins/render/mapscale/MapScaleFloatItem.cpp df0bb57 
>   src/plugins/render/overviewmap/OverviewMap.cpp ceb56ba 
> 
> Diff: https://git.reviewboard.kde.org/r/115622/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Piotr Rżysko
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/marble-devel/attachments/20140212/b2c936a3/attachment.html>


More information about the Marble-devel mailing list