X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-studio%2Ftrunk%2Fsrc%2Fgtkmm%2Fworkarea.cpp;h=ba0d49be46b109d1243c9dcaa248ba6d5d899f0a;hb=4f7ed97f65e0e42ebec5fa0abe76bc2c9bd6c280;hp=41da0b52d645caaaaed52169e9a10448cbee1108;hpb=fcd2fc006735303210ef752914d3ad026058d025;p=synfig.git diff --git a/synfig-studio/trunk/src/gtkmm/workarea.cpp b/synfig-studio/trunk/src/gtkmm/workarea.cpp index 41da0b5..ba0d49b 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 @@ -809,6 +810,19 @@ WorkArea::~WorkArea() render_idle_func_id=0; } +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 WorkArea::save_meta_data() { @@ -2173,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;