From: dvlierop2 Date: Sun, 12 Jul 2009 13:26:17 +0000 (+0000) Subject: Don't allow the "proportion" parameter of a star to become NaN, because this will... X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=10d0b1f3ffc0e1e1c0539b12851b04cea1d57222;p=inkscape.git Don't allow the "proportion" parameter of a star to become NaN, because this will lead to a crash (i.e. give a continuity error in 2geom). This occured when snapping both handles of a star to the same grid intersection and subsequently drawing a new star --- diff --git a/src/widgets/toolbox.cpp b/src/widgets/toolbox.cpp index 9ac009a84..21b0e97ac 100644 --- a/src/widgets/toolbox.cpp +++ b/src/widgets/toolbox.cpp @@ -2384,8 +2384,10 @@ static void sp_stb_proportion_value_changed( GtkAdjustment *adj, GObject *dataKl SPDesktop *desktop = (SPDesktop *) g_object_get_data( dataKludge, "desktop" ); if (sp_document_get_undo_sensitive(sp_desktop_document(desktop))) { - Inkscape::Preferences *prefs = Inkscape::Preferences::get(); - prefs->setDouble("/tools/shapes/star/proportion", adj->value); + if (!IS_NAN(adj->value)) { + Inkscape::Preferences *prefs = Inkscape::Preferences::get(); + prefs->setDouble("/tools/shapes/star/proportion", adj->value); + } } // quit if run by the attr_changed listener