The International Simutrans Forum

 

Author Topic: r1942 - Drag tools work as double click when left button being released  (Read 2977 times)

0 Members and 1 Guest are viewing this topic.

Offline z9999

  • Devotees (Inactive)
  • *
  • Posts: 848
r1942 GDI

Problem:
- Raise land tool works as double click when left button being released after dragging
- Add forest tool works as double click when left button being released after dragging

Note:
This is an another problem.
In r1943, All drag tools and drag scrooll work only with pausing but don't work well with playing mode.
« Last Edit: August 21, 2008, 10:19:10 AM by z9999 »

Offline z9999

  • Devotees (Inactive)
  • *
  • Posts: 848
Re: r1942 - Drag tools work as double click when left button being released
« Reply #1 on: August 12, 2008, 04:47:54 PM »
Code: [Select]
Index: simwerkz.cc
===================================================================
--- simwerkz.cc (r1947)
+++ simwerkz.cc (copy)
@@ -570,9 +570,6 @@
  default_param = NULL;
  return result;
  }
- else {
- is_dragging = false;
- }
  return NULL;
 }
 
@@ -608,6 +605,10 @@
  ok = true;
  }
  else {
+ if(is_dragging) {
+ is_dragging = false;
+ return NULL;
+ }
  n = welt->raise(pos);
  ok = (n!=0);
  }
@@ -648,10 +649,6 @@
  default_param = NULL;
  return result;
  }
- else {
- default_param = NULL;
- is_dragging = false;
- }
  return NULL;
 }
 
@@ -687,6 +684,10 @@
  ok = welt->lookup_hgt(pos);
  }
  else {
+ if(is_dragging) {
+ is_dragging = false;
+ return NULL;
+ }
  n = welt->lower(pos);
  ok = (n!=0);
  }
@@ -3101,25 +3102,6 @@
  welt->mark_area(nw, wh, true);
  }
  }
- else {
- if(marked!=NULL) {
- welt->mark_area(nw, wh, false);
- // prepare for building!
- nw = gr->gib_pos();
-
- wh.x = abs(nw.x-start.x)+1;
- wh.y = abs(nw.y-start.y)+1;
- nw.x = min(start.x, nw.x)+(wh.x/2);
- nw.y = min(start.y, nw.y)+(wh.y/2);
-
- // remove old pointers
- init(welt,sp);
-
- baum_t::create_forest( welt, nw.gib_2d(), wh );
- }
- // init anyway
- init( welt, sp );
- }
  return NULL;
 }
 


Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 10642
  • Languages: De,EN,JP
Re: r1942 - Drag tools work as double click when left button being released
« Reply #2 on: August 12, 2008, 06:36:49 PM »
Tahnk you, forgot about that. Do you find this system of handling stuff better?

Offline z9999

  • Devotees (Inactive)
  • *
  • Posts: 848
Re: r1942 - Drag tools work as double click when left button being released
« Reply #3 on: August 13, 2008, 11:41:48 AM »
Yes, I like the new one better. And also response and performance in r1950 is good.
Thank you.  :)