The International Simutrans Forum

 

Author Topic: Problems to capture the cursor on the minimap  (Read 4438 times)

0 Members and 1 Guest are viewing this topic.

Offline Yona-TYT ve

  • Devotee
  • *
  • Posts: 1174
    • Simutrans-BLOG
  • Languages: ES
Problems to capture the cursor on the minimap
« 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


Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4555
  • Languages: EN, DE, AT
Re: Problems to capture the cursor on the minimap
« Reply #1 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?

Offline Yona-TYT ve

  • Devotee
  • *
  • Posts: 1174
    • Simutrans-BLOG
  • Languages: ES
Re: Problems to capture the cursor on the minimap
« Reply #2 on: November 27, 2013, 10:26:01 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

Offline Yona-TYT ve

  • Devotee
  • *
  • Posts: 1174
    • Simutrans-BLOG
  • Languages: ES
Re: Problems to capture the cursor on the minimap
« Reply #3 on: November 28, 2013, 05:49:32 PM »
is possible to correct this?

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4555
  • Languages: EN, DE, AT
Re: Problems to capture the cursor on the minimap
« Reply #4 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.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9409
  • Languages: De,EN,JP
Re: Problems to capture the cursor on the minimap
« Reply #5 on: November 29, 2013, 10:51:33 PM »
I still cannot reproduce any problems on windows.

Offline Yona-TYT ve

  • Devotee
  • *
  • Posts: 1174
    • Simutrans-BLOG
  • Languages: ES
Re: Problems to capture the cursor on the minimap
« Reply #6 on: November 30, 2013, 02:44:56 AM »

if I move the cursor abruptly to these edges exits the margin




Just right-click drag up or to the left of the minimap ;)

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4555
  • Languages: EN, DE, AT
Re: Problems to capture the cursor on the minimap
« Reply #7 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.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9409
  • Languages: De,EN,JP
Re: Problems to capture the cursor on the minimap
« Reply #8 on: November 30, 2013, 11:13:59 PM »
It worked fine under windows, with SDL as well as with GDI for me ???

Offline Yona-TYT ve

  • Devotee
  • *
  • Posts: 1174
    • Simutrans-BLOG
  • Languages: ES
Re: Problems to capture the cursor on the minimap
« Reply #9 on: December 01, 2013, 12:35:06 AM »

I hope this video clears doubts ;)
https://www.youtube.com/watch?v=6QuShE_YURU

Offline kierongreen

  • Dev Team, Coder/patcher
  • Devotee
  • *
  • Posts: 2269
Re: Problems to capture the cursor on the minimap
« Reply #10 on: December 01, 2013, 08:32:35 AM »
Fixed in 6948:
Code: [Select]
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 );

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4555
  • Languages: EN, DE, AT
Re: Problems to capture the cursor on the minimap
« Reply #11 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.

Offline kierongreen

  • Dev Team, Coder/patcher
  • Devotee
  • *
  • Posts: 2269
Re: Problems to capture the cursor on the minimap
« Reply #12 on: December 01, 2013, 07:29:18 PM »
It's meant to jump though isn't it?

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9409
  • Languages: De,EN,JP
Re: Problems to capture the cursor on the minimap
« Reply #13 on: December 02, 2013, 12:18:03 AM »
Hmm guys it still works flawless on the two machines I could grab over the weekend.

Offline Yona-TYT ve

  • Devotee
  • *
  • Posts: 1174
    • Simutrans-BLOG
  • Languages: ES
Re: Problems to capture the cursor on the minimap
« Reply #14 on: December 02, 2013, 12:31:23 AM »
 :o :o :o :o :o :o

Offline kierongreen

  • Dev Team, Coder/patcher
  • Devotee
  • *
  • Posts: 2269
Re: Problems to capture the cursor on the minimap
« Reply #15 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.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5447
  • Languages: EN, NO
Re: Problems to capture the cursor on the minimap
« Reply #16 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.

Offline Yona-TYT ve

  • Devotee
  • *
  • Posts: 1174
    • Simutrans-BLOG
  • Languages: ES
Re: Problems to capture the cursor on the minimap
« Reply #17 on: December 03, 2013, 11:48:21 PM »


Is harder than it seems right?...
:P
« Last Edit: December 04, 2013, 12:04:13 AM by Yona-TYT »

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9409
  • Languages: De,EN,JP
Re: Problems to capture the cursor on the minimap
« Reply #18 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.

Offline Yona-TYT ve

  • Devotee
  • *
  • Posts: 1174
    • Simutrans-BLOG
  • Languages: ES
Re: Problems to capture the cursor on the minimap
« Reply #19 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 ;)
« Last Edit: December 05, 2013, 04:31:02 AM by Yona-TYT »