Don't allow 'splits' to be less than 1, or we get a division by zero and an infinite...
[synfig.git] / synfig-core / trunk / src / modules / mod_particle / plant.cpp
index c97d3ae..7affc15 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);