X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-core%2Ftrunk%2Fsrc%2Fsynfig%2Ftime.cpp;h=f9fae684fa5aa60543030d8eaab4a5be3b77c375;hb=0c558bd52dc8777ad065d39d9defaf2e05946867;hp=ea59b8e1ddae4696ec5abfe8c2d5b299d2ca0640;hpb=756c0d29ac1742f231e6615f9a577e574e35a4af;p=synfig.git diff --git a/synfig-core/trunk/src/synfig/time.cpp b/synfig-core/trunk/src/synfig/time.cpp index ea59b8e..f9fae68 100644 --- a/synfig-core/trunk/src/synfig/time.cpp +++ b/synfig-core/trunk/src/synfig/time.cpp @@ -7,6 +7,8 @@ ** \legal ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley ** Copyright (c) 2007, 2008 Chris Moore +** Copyright (c) 2008 Gerco Ballintijn +** Copyright (c) 2008 Carlos López ** ** This package is free software; you can redistribute it and/or ** modify it under the terms of the GNU General Public License as @@ -37,6 +39,7 @@ #include #include #include +#include #include #include @@ -182,11 +185,12 @@ Time::get_string(float fps, Time::Format format)const if(ceil(time.value_)-time.value_0) + return strprintf("%df", round_to_int(time * fps)); + else + return strprintf("%ds", round_to_int(time * 1)); + } + String ret; bool started = false; @@ -238,7 +250,7 @@ Time::get_string(float fps, Time::Format format)const started = true; } - if(format<=FORMAT_FULL || frame || !started) + if(format<=FORMAT_FULL || abs(frame) > epsilon_() || !started) { if (!(format<=FORMAT_NOSPACES) && started) ret += " ";