X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-core%2Ftrunk%2Fsrc%2Fmodules%2Fmod_particle%2Fplant.cpp;h=29dab46088a4b5ae71c2ecb66f0d217230b31f14;hb=e3f4437fedbdd74aebbf1675723978853dac8a8b;hp=c97d3aec934882acec1332fadded9ffa7d319640;hpb=715cd2ff1c66dde194d89615b447fcbe86f3ccc6;p=synfig.git diff --git a/synfig-core/trunk/src/modules/mod_particle/plant.cpp b/synfig-core/trunk/src/modules/mod_particle/plant.cpp index c97d3ae..29dab46 100644 --- a/synfig-core/trunk/src/modules/mod_particle/plant.cpp +++ b/synfig-core/trunk/src/modules/mod_particle/plant.cpp @@ -1,6 +1,6 @@ /* === S Y N F I G ========================================================= */ /*! \file plant.cpp -** \brief Template +** \brief Implementation of the "Plant" layer ** ** $Id$ ** @@ -65,8 +65,8 @@ using namespace etl; SYNFIG_LAYER_INIT(Plant); SYNFIG_LAYER_SET_NAME(Plant,"plant"); -SYNFIG_LAYER_SET_LOCAL_NAME(Plant,_("Plant")); -SYNFIG_LAYER_SET_CATEGORY(Plant,_("Other")); +SYNFIG_LAYER_SET_LOCAL_NAME(Plant,N_("Plant")); +SYNFIG_LAYER_SET_CATEGORY(Plant,N_("Other")); SYNFIG_LAYER_SET_VERSION(Plant,"0.1"); SYNFIG_LAYER_SET_CVS_ID(Plant,"$Id$"); @@ -284,7 +284,11 @@ Plant::set_param(const String & param, const ValueBase &value) else if (step > 1) step=1; }); - IMPORT_PLUS(splits,needs_sync_=true); + IMPORT_PLUS(splits,{ + needs_sync_=true; + if (splits < 1) + splits = 1; + }); IMPORT_PLUS(sprouts,needs_sync_=true); IMPORT_PLUS(random_factor,needs_sync_=true); IMPORT_PLUS(drag,needs_sync_=true); @@ -457,6 +461,9 @@ Plant::accelerated_render(Context context,Surface *surface,int quality, const Re const Real pw = (br[0] - tl[0]) / w; const Real ph = (br[1] - tl[1]) / h; + if (isinf(pw) || isinf(ph)) + return true; + if(needs_sync_==true) sync();