From 88ce128b7cd6fb5699e97ab4d3e7263414262aba Mon Sep 17 00:00:00 2001 From: dooglus Date: Mon, 14 Jan 2008 18:01:25 +0000 Subject: [PATCH] Fix 1824437: studio occasionally renders the tiles in the wrong places. This was happening when the canvas was one pixel greater than an integer number of tiles wide, and low-resolution rendering (the default) was enabled. git-svn-id: http://svn.voria.com/code@1362 1f10aa63-cdf2-0310-b900-c93c546f37ac --- synfig-studio/trunk/src/gtkmm/renderer_canvas.cpp | 2 +- synfig-studio/trunk/src/gtkmm/workarea.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/synfig-studio/trunk/src/gtkmm/renderer_canvas.cpp b/synfig-studio/trunk/src/gtkmm/renderer_canvas.cpp index 0901bff..26f62c8 100644 --- a/synfig-studio/trunk/src/gtkmm/renderer_canvas.cpp +++ b/synfig-studio/trunk/src/gtkmm/renderer_canvas.cpp @@ -151,7 +151,7 @@ Renderer_Canvas::render_vfunc( } else { - const int width_in_tiles(w/tile_w+(w%tile_w?1:0)); + const int width_in_tiles(w/tile_w+(((get_work_area()->get_low_resolution_flag())?((w/2)%(tile_w/2)):(w%tile_w))?1:0)); const int height_in_tiles(h/tile_h+(h%tile_h?1:0)); int u(0),v(0),tx,ty; diff --git a/synfig-studio/trunk/src/gtkmm/workarea.cpp b/synfig-studio/trunk/src/gtkmm/workarea.cpp index 2f00672..6e31a6e 100644 --- a/synfig-studio/trunk/src/gtkmm/workarea.cpp +++ b/synfig-studio/trunk/src/gtkmm/workarea.cpp @@ -1976,7 +1976,7 @@ WorkArea::next_unrendered_tile(int refreshes)const x(focus_point[0]/pw+drawing_area->get_width()/2-w/2), y(focus_point[1]/ph+drawing_area->get_height()/2-h/2); - const int width_in_tiles(w/tile_w+(w%tile_w?1:0)); + const int width_in_tiles(w/tile_w+((low_resolution?((w/2)%(tile_w/2)):(w%tile_w))?1:0)); const int height_in_tiles(h/tile_h+(h%tile_h?1:0)); int -- 2.7.4