X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-studio%2Ftrunk%2Fsrc%2Fgtkmm%2Fworkarea.cpp;h=313646fce09801f298674366f50898228ffe0526;hb=3cc0ca894a70090b26789e4c85fd25db035b6673;hp=5ab2563d75fda9cbd1a40913fe5b2423540b31cb;hpb=5fea0516b9b99395bfe20211e5c82563ca058150;p=synfig.git diff --git a/synfig-studio/trunk/src/gtkmm/workarea.cpp b/synfig-studio/trunk/src/gtkmm/workarea.cpp index 5ab2563..313646f 100644 --- a/synfig-studio/trunk/src/gtkmm/workarea.cpp +++ b/synfig-studio/trunk/src/gtkmm/workarea.cpp @@ -7,6 +7,7 @@ ** \legal ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley ** Copyright 2006 Yue Shi Lai +** Copyright (c) 2007 Chris Moore ** ** This package is free software; you can redistribute it and/or ** modify it under the terms of the GNU General Public License as @@ -806,11 +807,20 @@ WorkArea::~WorkArea() // don't leave the render function queued if we are about to vanish; // that causes crashes if(render_idle_func_id) - { - synfig::info("g_source_remove() returns %d", g_source_remove(render_idle_func_id)); render_idle_func_id=0; - } else - synfig::info("no render_idle_func_id to clear\n"); +} + +bool +WorkArea::get_updating()const +{ + return App::single_threaded && async_renderer && async_renderer->updating; +} + +void +WorkArea::stop_updating(bool cancel) +{ + async_renderer->stop(); + if (cancel) canceled_=true; } void @@ -1051,7 +1061,7 @@ void WorkArea::set_focus_point(const synfig::Point &point) { // These next three lines try to ensure that we place the - // focus on a pixel boundry + // focus on a pixel boundary /*Point adjusted(point[0]/abs(get_pw()),point[1]/abs(get_ph())); adjusted[0]=(abs(adjusted[0]-floor(adjusted[0]))<0.5)?floor(adjusted[0])*abs(get_pw()):ceil(adjusted[0])*abs(get_ph()); adjusted[1]=(abs(adjusted[1]-floor(adjusted[1]))<0.5)?floor(adjusted[1])*abs(get_ph()):ceil(adjusted[1])*abs(get_ph()); @@ -1192,7 +1202,7 @@ WorkArea::on_drawing_area_event(GdkEvent *event) modifier=Gdk::ModifierType(event->button.state); } - // Make sure we recognise the device + // Make sure we recognize the device if(curr_input_device) { if(curr_input_device!=device) @@ -1258,7 +1268,7 @@ WorkArea::on_drawing_area_event(GdkEvent *event) // GDK mouse scrolling events else if(event->any.type==GDK_SCROLL) { - // GDK information needed to properly interprete mouse + // GDK information needed to properly interpret mouse // scrolling events are: scroll.state, scroll.x/scroll.y, and // scroll.direction. The value of scroll.direction will be // obtained later. @@ -1485,7 +1495,7 @@ WorkArea::on_drawing_area_event(GdkEvent *event) signal_cursor_moved_(); - // Guide/Duck hilights on hover + // Guide/Duck highlights on hover if(dragging==DRAG_NONE) { GuideList::iterator iter; @@ -2177,6 +2187,13 @@ public: bool studio::WorkArea::async_update_preview() { + if (get_updating()) + { + stop_updating(); + queue_render_preview(); + return false; + } + async_renderer=0; queued=false; @@ -2470,6 +2487,7 @@ WorkArea::queue_scroll() drawing_area->queue_draw_area(4-dx, 4-dy, 4-dx+timecode_width, 4-dy+timecode_height); } +#ifndef USE_FRAME_BACKGROUND_TO_SHOW_EDIT_MODE if(canvas_interface->get_mode()&synfigapp::MODE_ANIMATE) { int maxx = drawing_area->get_width()-1; @@ -2496,6 +2514,7 @@ WorkArea::queue_scroll() drawing_area->queue_draw_area(0, -dy, maxx, -dy); } } +#endif // USE_FRAME_BACKGROUND_TO_SHOW_EDIT_MODE last_focus_point=focus_point; } @@ -2626,12 +2645,12 @@ studio::WorkArea::set_cursor(Gdk::CursorType x) drawing_area->get_window()->set_cursor(Gdk::Cursor(x)); } -#include "iconcontroler.h" +#include "iconcontroller.h" void studio::WorkArea::refresh_cursor() { -// set_cursor(IconControler::get_tool_cursor(canvas_view->get_smach().get_state_name(),drawing_area->get_window())); +// set_cursor(IconController::get_tool_cursor(canvas_view->get_smach().get_state_name(),drawing_area->get_window())); } void