Tidying a little.
[synfig.git] / synfig-core / trunk / src / modules / mod_particle / plant.cpp
index c97d3ae..3cad963 100644 (file)
@@ -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();