The International Simutrans Forum

Development => Patches & Projects => Incorporated Patches and Solved Bug Reports => Topic started by: z9999 on August 08, 2008, 11:05:01 pm

Title: r1942 - Drag tools work as double click when left button being released
Post by: z9999 on August 08, 2008, 11:05:01 pm
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.
Title: Re: r1942 - Drag tools work as double click when left button being released
Post by: z9999 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;
 }
 

Title: Re: r1942 - Drag tools work as double click when left button being released
Post by: prissi on August 12, 2008, 06:36:49 pm
Tahnk you, forgot about that. Do you find this system of handling stuff better?
Title: Re: r1942 - Drag tools work as double click when left button being released
Post by: z9999 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.  :)