The International Simutrans Forum

Development => Bug Reports => Topic started by: Yona-TYT on November 26, 2013, 10:18:14 PM

Title: Problems to capture the cursor on the minimap
Post by: Yona-TYT on November 26, 2013, 10:18:14 PM

I still have problems capturing the cursor on the left edge and the top of the minimap, if I move the cursor abruptly to these edges exits the margin

(http://img819.imageshack.us/img819/8959/xkg.gif)
Title: Re: Problems to capture the cursor on the minimap
Post by: Dwachs on November 27, 2013, 07:12:19 AM
I do not know whether I understood you right: The problem you described happens if you start dragging with the mouse inside the minimap but the mouse cursor leaves the minimap window?
Title: Re: Problems to capture the cursor on the minimap
Post by: Yona-TYT on November 27, 2013, 10:26:01 AM

Quote from: Dwachs on November 27, 2013, 07:12:19 AM
I do not know whether I understood you right: The problem you described happens if you start dragging with the mouse inside the minimap but the mouse cursor leaves the minimap window?
Exactly
(http://img542.imageshack.us/img542/2718/fy5.gif)
Title: Re: Problems to capture the cursor on the minimap
Post by: Yona-TYT on November 28, 2013, 05:49:32 PM
is possible to correct this?
Title: Re: Problems to capture the cursor on the minimap
Post by: Dwachs on November 29, 2013, 05:15:59 PM
Somehow the scrollbars are not updated correctly. This certainly can be fixed, but I do not know how.

I could fix it by just ignoring the dragging if the mouse leaves the map window.
Title: Re: Problems to capture the cursor on the minimap
Post by: prissi on November 29, 2013, 10:51:33 PM
I still cannot reproduce any problems on windows.
Title: Re: Problems to capture the cursor on the minimap
Post by: Yona-TYT on November 30, 2013, 02:44:56 AM

Quote from: Yona-TYT on November 26, 2013, 10:18:14 PM
if I move the cursor abruptly to these edges exits the margin




Just right-click drag up or to the left of the minimap ;)
Title: Re: Problems to capture the cursor on the minimap
Post by: Dwachs on November 30, 2013, 10:21:30 AM
I get jumping if the minimap is not fully shown, scrolled to the right. Then drag with left mouse button pressed to the left. As soon as the mouse pointer leaves the window the content of the minimap jumps.
Title: Re: Problems to capture the cursor on the minimap
Post by: prissi on November 30, 2013, 11:13:59 PM
It worked fine under windows, with SDL as well as with GDI for me ???
Title: Re: Problems to capture the cursor on the minimap
Post by: Yona-TYT on December 01, 2013, 12:35:06 AM

I hope this video clears doubts ;)
https://www.youtube.com/watch?v=6QuShE_YURU (https://www.youtube.com/watch?v=6QuShE_YURU)
Title: Re: Problems to capture the cursor on the minimap
Post by: kierongreen on December 01, 2013, 08:32:35 AM
Fixed in 6948:

Index: gui/map_frame.cc
===================================================================
--- gui/map_frame.cc (revision 6947)
+++ gui/map_frame.cc (working copy)
@@ -440,7 +440,7 @@
is_cursor_hidden = false;
return true;
}
- else if(  IS_RIGHTDRAG(ev)  &&  reliefkarte_t::get_karte()->getroffen(ev2.mx,ev2.my)  &&  reliefkarte_t::get_karte()->getroffen(ev2.cx,ev2.cy)  ) {
+ else if(  IS_RIGHTDRAG(ev)  &&  (reliefkarte_t::get_karte()->getroffen(ev2.mx,ev2.my)  ||  reliefkarte_t::get_karte()->getroffen(ev2.cx,ev2.cy))  ) {
int x = scrolly.get_scroll_x();
int y = scrolly.get_scroll_y();
const int scroll_direction = ( env_t::scroll_multi>0 ? 1 : -1 );

Title: Re: Problems to capture the cursor on the minimap
Post by: Dwachs on December 01, 2013, 03:21:17 PM
LEFTDRAG-events are still not correctly handled. Try left-dragging out of the window. Then minimap content jumps as soon as the cursor leaves the windwo.
Title: Re: Problems to capture the cursor on the minimap
Post by: kierongreen on December 01, 2013, 07:29:18 PM
It's meant to jump though isn't it?
Title: Re: Problems to capture the cursor on the minimap
Post by: prissi on December 02, 2013, 12:18:03 AM
Hmm guys it still works flawless on the two machines I could grab over the weekend.
Title: Re: Problems to capture the cursor on the minimap
Post by: Yona-TYT on December 02, 2013, 12:31:23 AM
 :o :o :o :o :o :o
Title: Re: Problems to capture the cursor on the minimap
Post by: kierongreen on December 02, 2013, 12:33:43 AM
I could definitely reproduce RightDrag issue. Seemed fairly obvious that the check required that both current mouse cursor and event start cursor were within the frame. Though I still don't get how it managed to work at the right and lower edges but not at the left or top.
Title: Re: Problems to capture the cursor on the minimap
Post by: Ters on December 02, 2013, 06:15:33 AM
I've got no problems with right dragging in both r6895 and r6948, but left dragging does a rather sudden jump to the edge of the world when the cursor passes outside the minimap. For the bottom and right edges, it also does an extra jump as the drag affects the scroll bars.
Title: Re: Problems to capture the cursor on the minimap
Post by: Yona-TYT on December 03, 2013, 11:48:21 PM


Is harder than it seems right?... :P
Title: Re: Problems to capture the cursor on the minimap
Post by: prissi on December 04, 2013, 10:12:23 AM
It did not jump on any computer I could test, apart from the time when the map does not scroll because it is caught by the scrollbar.
Title: Re: Problems to capture the cursor on the minimap
Post by: Yona-TYT on December 05, 2013, 04:22:37 AM

Oh! sorry I think I was a little confused :o


The r6960 works well... :P


Compare r6960 with the r6947 and notice the difference ;)