Author: cazfi
Date: Wed Jul 27 11:02:04 2016
New Revision: 33335

URL: http://svn.gna.org/viewcvs/freeciv?rev=33335&view=rev
Log:
When going through zoom steps, stop before terminator values, not at them.

See bug #24879

Modified:
    trunk/client/zoom.c

Modified: trunk/client/zoom.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/zoom.c?rev=33335&r1=33334&r2=33335&view=diff
==============================================================================
--- trunk/client/zoom.c (original)
+++ trunk/client/zoom.c Wed Jul 27 11:02:04 2016
@@ -1,4 +1,4 @@
-/********************************************************************** 
+/***********************************************************************
  Freeciv - Copyright (C) 2005 - The Freeciv Team
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -25,7 +25,7 @@
 bool zoom_enabled = FALSE;
 
 static float zoom_steps[] = {
-  -1.0, 0.10, 0.25, 0.5, 0.75, 1.0, 1.25, 1.5, 2.0, 2.5, 3.0, 4.0, -1.0
+  -1.0, 0.13, 0.25, 0.5, 0.75, 1.0, 1.25, 1.5, 2.0, 2.5, 3.0, 4.0, -1.0
 };
 
 static struct zoom_data
@@ -69,12 +69,12 @@
   /* Even if below previous step, close enough is considered to be in
    * previous step so that change is not miniscule */
   for (i = 1 ;
-       zoom_steps[i] < map_zoom * 1.05 && zoom_steps[i] > 0 ;
+       zoom_steps[i] < map_zoom * 1.05 && zoom_steps[i] > 0.0 ;
        i++ ) {
     /* empty */
   }
 
-  if (zoom_steps[i] > 0) {
+  if (zoom_steps[i] > 0.0) {
     if (zoom_steps[i] > 0.99 && zoom_steps[i] < 1.01) {
       zoom_1_0();
     } else {
@@ -93,12 +93,12 @@
   /* Even if above previous step, close enough is considered to be in
    * previous step so that change is not miniscule */
   for (i = ARRAY_SIZE(zoom_steps) - 2 ;
-       zoom_steps[i] * 1.05 > map_zoom && zoom_steps[i] > 0 ;
+       zoom_steps[i] * 1.05 > map_zoom && zoom_steps[i] > 0.0 ;
        i-- ) {
     /* empty */
   }
 
-  if (zoom_steps[i] > 0) {
+  if (zoom_steps[i] > 0.0) {
     if (zoom_steps[i] > 0.99 && zoom_steps[i] < 1.01) {
       zoom_1_0();
     } else {


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

Reply via email to