Don't allow 'splits' to be less than 1, or we get a division by zero and an infinite...
authordooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Wed, 24 Oct 2007 21:56:13 +0000 (21:56 +0000)
committerdooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Wed, 24 Oct 2007 21:56:13 +0000 (21:56 +0000)
git-svn-id: http://svn.voria.com/code@964 1f10aa63-cdf2-0310-b900-c93c546f37ac

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);