News:

SimuTranslator
Make Simutrans speak your language.

Problems to capture the cursor on the minimap

Started by Yona-TYT, November 26, 2013, 10:18:14 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Yona-TYT


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


Dwachs

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?
Parsley, sage, rosemary, and maggikraut.

Yona-TYT


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


Dwachs

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.
Parsley, sage, rosemary, and maggikraut.

prissi

I still cannot reproduce any problems on windows.

Yona-TYT


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 ;)

Dwachs

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.
Parsley, sage, rosemary, and maggikraut.

prissi

It worked fine under windows, with SDL as well as with GDI for me ???


kierongreen

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 );


Dwachs

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.
Parsley, sage, rosemary, and maggikraut.

kierongreen


prissi

Hmm guys it still works flawless on the two machines I could grab over the weekend.


kierongreen

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.

Ters

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.

Yona-TYT

#17


Is harder than it seems right?...
:P

prissi

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.

Yona-TYT

#19

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


The r6960 works well... :P


Compare r6960 with the r6947 and notice the difference ;)