From dfad76343452004bb06c92d19262d22dc3cb9e76 Mon Sep 17 00:00:00 2001 From: Eduard Braun Date: Mon, 4 Dec 2017 23:15:36 +0100 Subject: Prevent setting zero radius While the spec explicitly allows for that (and it should disable rendering of the element) Inkscape does not allow setting a zero radius at runtime (it works fine when opening an existing file). If we still force this during runtime we end up with a "ghost" ellipse on canvas which looks as if it had the old radius but has control points according to the zero radius and has the added bonus of not being movable (or rather being movable but snapping back back immediately when released) until updating the radius with a valid number again which finally moves the ellipse to wherever it should have been. --- src/widgets/arc-toolbar.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/widgets/arc-toolbar.cpp') diff --git a/src/widgets/arc-toolbar.cpp b/src/widgets/arc-toolbar.cpp index 77f74b348..0e503cd5e 100644 --- a/src/widgets/arc-toolbar.cpp +++ b/src/widgets/arc-toolbar.cpp @@ -82,6 +82,13 @@ static void sp_arctb_sensitivize( GObject *tbl, double v1, double v2 ) static void sp_arctb_value_changed(GtkAdjustment *adj, GObject *tbl, gchar const *value_name) { + // Per SVG spec "a [radius] value of zero disables rendering of the element". + // However our implementation does not allow a setting of zero in the UI (not even in the XML editor) + // and ugly things happen if it's forced here, so better leave the properties untouched. + if (!gtk_adjustment_get_value(adj)) { + return; + } + SPDesktop *desktop = static_cast(g_object_get_data( tbl, "desktop" )); UnitTracker* tracker = reinterpret_cast(g_object_get_data( tbl, "tracker" )); -- cgit v1.2.3