Fix the error about being unable to parse the grid_size metadata. It was previously...
[synfig.git] / synfig-studio / trunk / src / gtkmm / workarea.cpp
index 228c087..9b77c6c 100644 (file)
@@ -630,14 +630,14 @@ WorkArea::WorkArea(etl::loose_handle<synfigapp::CanvasInterface> canvas_interfac
        canvas(canvas_interface->get_canvas()),
        scrollx_adjustment(0,-4,4,0.01,0.1),
        scrolly_adjustment(0,-4,4,0.01,0.1),
-       w(128),
-       h(128),
+       w(TILE_SIZE),
+       h(TILE_SIZE),
        last_event_time(0),
        progresscallback(0),
        dragging(DRAG_NONE),
        show_grid(false),
-       tile_w(128),
-       tile_h(128),
+       tile_w(TILE_SIZE),
+       tile_h(TILE_SIZE),
        timecode_width(0),
        timecode_height(0)
 {
@@ -892,6 +892,8 @@ WorkArea::load_meta_data()
 
                if(!tmp.empty())
                        gx=stratof(tmp);
+               else
+                       synfig::error("WorkArea::load_meta_data(): Unable to parse data for \"grid_size\", which was \"%s\"",data.c_str());
 
                if(iter==data.end())
                        tmp.clear();
@@ -900,11 +902,11 @@ WorkArea::load_meta_data()
 
                if(!tmp.empty())
                        gy=stratof(tmp);
+               else
+                       synfig::error("WorkArea::load_meta_data(): Unable to parse data for \"grid_size\", which was \"%s\"",data.c_str());
 
                set_grid_size(Vector(gx,gy));
        }
-       else
-               synfig::error("WorkArea::load_meta_data(): Unable to parse data for \"grid_size\", which was \"%s\"",data.c_str());
 
        data=canvas->get_meta_data("grid_show");
        if(data.size() && (data=="1" || data[0]=='t' || data[0]=='T'))
@@ -1869,10 +1871,8 @@ WorkArea::on_vruler_event(GdkEvent */*event*/)
        switch(event->type)
     {
        case GDK_BUTTON_PRESS:
-               DEBUGPOINT();
                if(dragging==DRAG_NONE)
                {
-                       DEBUGPOINT();
                        dragging=DRAG_GUIDE;
                        curr_guide=get_guide_list_x().insert(get_guide_list_x().begin());
                        curr_guide_is_x=true;
@@ -1880,10 +1880,8 @@ WorkArea::on_vruler_event(GdkEvent */*event*/)
                return true;
                break;
        case GDK_BUTTON_RELEASE:
-               DEBUGPOINT();
                if(dragging==DRAG_GUIDE && curr_guide_is_x==true)
                {
-                       DEBUGPOINT();
                        dragging=DRAG_NONE;
                        get_guide_list_x().erase(curr_guide);
                }
@@ -1980,7 +1978,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