Author: mir3x
Date: Wed Jan 25 22:35:32 2017
New Revision: 34893

URL: http://svn.gna.org/viewcvs/freeciv?rev=34893&view=rev
Log:
Qt client - Fixed unit autocentering when left clicking something outside 
active unit visible screen. 

See bug #25466


Modified:
    trunk/client/gui-qt/mapctrl.cpp
    trunk/client/gui-qt/mapview.h

Modified: trunk/client/gui-qt/mapctrl.cpp
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-qt/mapctrl.cpp?rev=34893&r1=34892&r2=34893&view=diff
==============================================================================
--- trunk/client/gui-qt/mapctrl.cpp     (original)
+++ trunk/client/gui-qt/mapctrl.cpp     Wed Jan 25 22:35:32 2017
@@ -388,6 +388,8 @@
   sc = fc_shortcuts::sc()->get_shortcut(SC_SELECT_BUTTON);
   if (((key && key == sc->key) || bt == sc->mouse) && md == sc->mod) {
     if (goto_is_active() == false) {
+      stored_autocenter = gui_options.auto_center_on_unit;
+      gui_options.auto_center_on_unit = false;
       action_button_pressed(pos.x(), pos.y(), SELECT_FOCUS);
     }
     return;
@@ -432,6 +434,7 @@
     }
     if (keyboardless_goto_active == false || goto_is_active() == true) {
       action_button_pressed(pos.x(), pos.y(), SELECT_POPUP);
+      gui_options.auto_center_on_unit = stored_autocenter;
     }
     release_goto_button(pos.x(), pos.y());
     return;

Modified: trunk/client/gui-qt/mapview.h
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-qt/mapview.h?rev=34893&r1=34892&r2=34893&view=diff
==============================================================================
--- trunk/client/gui-qt/mapview.h       (original)
+++ trunk/client/gui-qt/mapview.h       Wed Jan 25 22:35:32 2017
@@ -102,6 +102,7 @@
 private:
   void update_font(const QString &name, const QFont &font);
 
+  bool stored_autocenter;
   int cursor_frame;
   int cursor;
 


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to