Skip to main content
Topic: r1942 - Drag tools work as double click when left button being released (Read 5059 times) previous topic - next topic

r1942 - Drag tools work as double click when left button being released

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.

Re: r1942 - Drag tools work as double click when left button being released

Reply #1
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;
 }
 


Re: r1942 - Drag tools work as double click when left button being released

Reply #2
Tahnk you, forgot about that. Do you find this system of handling stuff better?

Re: r1942 - Drag tools work as double click when left button being released

Reply #3
Yes, I like the new one better. And also response and performance in r1950 is good.
Thank you.  :)