X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-studio%2Ftrunk%2Fsrc%2Fgtkmm%2Fpreview.cpp;h=78f8749eed7294313dd7dfac0d444d27ca56d66a;hb=9fec9e45acee8a602a11699eac2dea3a0bfe4154;hp=682ad5023da4e57c69ebc2fdd21b7da818e82acf;hpb=837b63e9fb829d66d43f4f169861f8979f76820d;p=synfig.git diff --git a/synfig-studio/trunk/src/gtkmm/preview.cpp b/synfig-studio/trunk/src/gtkmm/preview.cpp index 682ad50..78f8749 100644 --- a/synfig-studio/trunk/src/gtkmm/preview.cpp +++ b/synfig-studio/trunk/src/gtkmm/preview.cpp @@ -6,6 +6,7 @@ ** ** \legal ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley +** 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 @@ -104,7 +105,7 @@ public: return false; } - virtual bool start_frame(ProgressCallback *cb=NULL) + virtual bool start_frame(ProgressCallback */*cb*/=NULL) { return true; } @@ -214,8 +215,8 @@ void studio::Preview::render() //setting the description - //HACK - BECAUSE THE RENDERER CAN'T RENDER INCLUDING THE LAST FRAME - desc.set_time_end(desc.get_time_end() + 1.3/fps); + //HACK - add on one extra frame because the renderer can't render the last frame + desc.set_time_end(desc.get_time_end() + 1.000001/fps); target->set_rend_desc(&desc); @@ -255,7 +256,7 @@ void studio::Preview::frame_finish(const Preview_Target *targ) if(!buffer) return; - //convert all the pixles to the pixbuf... buffer... thing... + //convert all the pixels to the pixbuf... buffer... thing... //synfig::warning("Converting..."); convert_color_format(buffer, surf[0], surf.get_w()*surf.get_h(), pf, App::gamma); @@ -514,7 +515,7 @@ void studio::Widget_Preview::preview_draw() draw_area.queue_draw();//on_expose_event(); } -bool studio::Widget_Preview::redraw(GdkEventExpose *heh) +bool studio::Widget_Preview::redraw(GdkEventExpose */*heh*/) { //And render the drawing area Glib::RefPtr pxnew, px = currentbuf; @@ -857,10 +858,15 @@ void studio::Widget_Preview::repreview() void studio::Widget_Preview::stoprender() { + // don't crash if the render has already been stopped + if (!preview->renderer) + return; + if(preview) - { - preview->renderer.detach(); - } + if (preview->renderer->updating) + preview->renderer->stop(); + else + preview->renderer.detach(); } void studio::Widget_Preview::eraseall()