From 5fea0516b9b99395bfe20211e5c82563ca058150 Mon Sep 17 00:00:00 2001 From: dooglus Date: Mon, 1 Oct 2007 21:48:48 +0000 Subject: [PATCH] Keep the red 'animate edit mode' border and the current keyframe name from leaving artifacts when scrolling. git-svn-id: http://svn.voria.com/code@807 1f10aa63-cdf2-0310-b900-c93c546f37ac --- .../trunk/src/gtkmm/renderer_timecode.cpp | 5 +++ synfig-studio/trunk/src/gtkmm/workarea.cpp | 44 ++++++++++++++++++---- synfig-studio/trunk/src/gtkmm/workarea.h | 3 ++ 3 files changed, 44 insertions(+), 8 deletions(-) diff --git a/synfig-studio/trunk/src/gtkmm/renderer_timecode.cpp b/synfig-studio/trunk/src/gtkmm/renderer_timecode.cpp index 7d5f357..235c71e 100644 --- a/synfig-studio/trunk/src/gtkmm/renderer_timecode.cpp +++ b/synfig-studio/trunk/src/gtkmm/renderer_timecode.cpp @@ -146,10 +146,15 @@ Renderer_Timecode::render_vfunc( gc->set_rgb_fg_color(Gdk::Color("#5f0000")); try { + int w, h; layout->set_text(canvas->keyframe_list().find(cur_time)->get_description()); + layout->get_size(w, h); + get_work_area()->timecode_width = int(w*1.0/Pango::SCALE); + get_work_area()->timecode_height = int(h*1.0/Pango::SCALE); } catch(synfig::Exception::NotFound) { + get_work_area()->timecode_width = get_work_area()->timecode_height = 0; return; } catch(...) { diff --git a/synfig-studio/trunk/src/gtkmm/workarea.cpp b/synfig-studio/trunk/src/gtkmm/workarea.cpp index dce50cd..5ab2563 100644 --- a/synfig-studio/trunk/src/gtkmm/workarea.cpp +++ b/synfig-studio/trunk/src/gtkmm/workarea.cpp @@ -634,7 +634,9 @@ WorkArea::WorkArea(etl::loose_handle canvas_interfac dragging(DRAG_NONE), show_grid(false), tile_w(128), - tile_h(128) + tile_h(128), + timecode_width(0), + timecode_height(0) { show_guides=true; curr_input_device=0; @@ -2462,13 +2464,39 @@ WorkArea::queue_scroll() drawing_area->get_window()->scroll(-dx,-dy); - /*drawing_area->queue_draw_area( - 0, - 0, - 128, - 64 - ); - */ + if (timecode_width && timecode_height) + { + drawing_area->queue_draw_area(4, 4, 4+timecode_width, 4+timecode_height); + drawing_area->queue_draw_area(4-dx, 4-dy, 4-dx+timecode_width, 4-dy+timecode_height); + } + + if(canvas_interface->get_mode()&synfigapp::MODE_ANIMATE) + { + int maxx = drawing_area->get_width()-1; + int maxy = drawing_area->get_height()-1; + + if (dx > 0) + { + drawing_area->queue_draw_area( 0, 0, 1, maxy); + drawing_area->queue_draw_area(maxx-dx, 0, maxx-dx, maxy); + } + else if (dx < 0) + { + drawing_area->queue_draw_area( maxx, 0, maxx, maxy); + drawing_area->queue_draw_area( -dx, 0, -dx, maxy); + } + if (dy > 0) + { + drawing_area->queue_draw_area(0, 0, maxx, 1); + drawing_area->queue_draw_area(0, maxy-dy, maxx, maxy-dy); + } + else if (dy < 0) + { + drawing_area->queue_draw_area(0, maxy, maxx, maxy); + drawing_area->queue_draw_area(0, -dy, maxx, -dy); + } + } + last_focus_point=focus_point; } diff --git a/synfig-studio/trunk/src/gtkmm/workarea.h b/synfig-studio/trunk/src/gtkmm/workarea.h index fa9ef0f..3946e79 100644 --- a/synfig-studio/trunk/src/gtkmm/workarea.h +++ b/synfig-studio/trunk/src/gtkmm/workarea.h @@ -276,6 +276,9 @@ public: // used in renderer_guides.cpp GuideList::iterator curr_guide; + // used in renderer_timecode.cpp + int timecode_width, timecode_height; + /* -- ** -- P R I V A T E M E T H O D S --------------------------------------- */ -- 2.7.4