Author: mir3x
Date: Sat Dec 26 12:19:27 2015
New Revision: 31217

URL: http://svn.gna.org/viewcvs/freeciv?rev=31217&view=rev
Log:
Resized minimap by default to exact same width as "end turn area" and height 
scaled to map width/height.

See patch #6721


Modified:
    branches/S2_6/client/gui-qt/mapview.cpp

Modified: branches/S2_6/client/gui-qt/mapview.cpp
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-qt/mapview.cpp?rev=31217&r1=31216&r2=31217&view=diff
==============================================================================
--- branches/S2_6/client/gui-qt/mapview.cpp     (original)
+++ branches/S2_6/client/gui-qt/mapview.cpp     Sat Dec 26 12:19:27 2015
@@ -1618,45 +1618,11 @@
 ****************************************************************************/
 void overview_size_changed(void)
 {
-  int map_width, map_height, over_width, over_height, ow, oh, oldx, oldy;
-  float ratio;
-
-  map_width = gui()->mapview_wdg->width();
-  map_height = gui()->mapview_wdg->height();
-  over_width = 2 * gui_options.overview.width;
-  over_height = 2 * gui_options.overview.height;
-
-  oldx = gui()->minimapview_wdg->pos().x()
-         + gui()->minimapview_wdg->size().width();
-  oldy = gui()->minimapview_wdg->pos().y()
-         + gui()->minimapview_wdg->size().height();
-  /* lower overview width size to max 20% of map width, keep aspect ratio*/
-  if (map_width/over_width < 5){
-    ratio = static_cast<float>(map_width)/over_width;
-    ow = static_cast<float>(map_width)/5.0;
-    ratio = static_cast<float>(over_width)/ow;
-    over_height=static_cast<float>(over_height)/ratio;
-    over_width=ow;
-  }
-  /* if height still too high lower again */
-  if (map_height/over_height < 5){
-    ratio = static_cast<float>(map_height)/over_height;
-    oh = static_cast<float>(map_height)/5.0;
-    ratio = static_cast<float>(over_height)/oh;
-    over_width=static_cast<float>(over_width)/ratio;
-    over_height = oh;
-  }
-  /* make minimap not less than 48x48 */
-  if (over_width < 48) {
-    over_width =48;
-  }
-  if (over_height < 48) {
-    over_height = 48;
-  }
-  /* Magic trick here */
   gui()->minimapview_wdg->resize(0, 0);
-  gui()->minimapview_wdg->resize(over_width, over_height);
-  gui()->minimapview_wdg->move(oldx - over_width, oldy - over_height);
+  gui()->minimapview_wdg->resize(gui()->end_turn_rect->width(),
+                                 gui()->end_turn_rect->width()
+                                 * (static_cast<float>(game.map.xsize)
+                                 / game.map.ysize));
 }
 
 /**************************************************************************


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

Reply via email to