fixed using (manually changed) invalid values for editor zoom tile size
authorHolger Schemel <info@artsoft.org>
Thu, 21 Feb 2019 07:24:04 +0000 (08:24 +0100)
committerHolger Schemel <info@artsoft.org>
Thu, 21 Feb 2019 07:24:04 +0000 (08:24 +0100)
src/editor.c

index 093b229083d6f4e3539ebfd28ccd0559718e21c2..dc1b528f90daf8ebaa38ee3d5c06c7420e7a2009 100644 (file)
@@ -8402,6 +8402,9 @@ static void InitZoomLevelSettings(int zoom_tilesize)
     ed_tilesize = setup.auto_setup.editor_zoom_tilesize;
     ed_tilesize_default = DEFAULT_EDITOR_TILESIZE;
 
+    // make sure that tile size is always a power of 2
+    ed_tilesize = (1 << log_2(ed_tilesize));
+
     if (level.game_engine_type == GAME_ENGINE_TYPE_MM)
     {
       ed_tilesize = DEFAULT_EDITOR_TILESIZE_MM;