From 57d919e86f044dc88c8526bc43bf1a69615e3ac5 Mon Sep 17 00:00:00 2001 From: cilix42 Date: Thu, 3 Jul 2008 09:40:42 +0000 Subject: [PATCH] Add new shape 'crescendo' in dropdown box of pen tool --- src/draw-context.cpp | 18 +++++++++++++++++- src/widgets/toolbox.cpp | 1 + 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/draw-context.cpp b/src/draw-context.cpp index 92bba8104..c40ea1991 100644 --- a/src/draw-context.cpp +++ b/src/draw-context.cpp @@ -274,7 +274,6 @@ spdc_check_for_and_apply_waiting_LPE(SPDrawContext *dc, SPItem *item) bool shape_applied = false; SPCSSAttr *css_item = sp_css_attr_from_object (SP_OBJECT(item), SP_STYLE_FLAG_ALWAYS); - const char *cfill = sp_repr_css_property(css_item, "fill", "none"); const char *cstroke = sp_repr_css_property(css_item, "stroke", "none"); switch (shape) { @@ -287,8 +286,24 @@ spdc_check_for_and_apply_waiting_LPE(SPDrawContext *dc, SPItem *item) static_cast(lpe)->pattern.on_paste_button_click(); shape_applied = true; + break; } case 2: + { + // TODO: this is only for illustration (we create a "crescendo"-shaped path + // manually; eventually we should read the path from a separate file) + SPCurve *c = new SPCurve(); + c->moveto(0,5); + c->lineto(200,10); + c->lineto(200,0); + c->closepath(); + spdc_paste_curve_as_param_path(c, dc, item); + c->unref(); + + shape_applied = true; + break; + } + case 3: { // TODO: this is only for illustration (we create a "decrescendo"-shaped path // manually; eventually we should read the path from a separate file) @@ -301,6 +316,7 @@ spdc_check_for_and_apply_waiting_LPE(SPDrawContext *dc, SPItem *item) c->unref(); shape_applied = true; + break; } default: break; diff --git a/src/widgets/toolbox.cpp b/src/widgets/toolbox.cpp index 8fa52c281..148694ef9 100644 --- a/src/widgets/toolbox.cpp +++ b/src/widgets/toolbox.cpp @@ -3342,6 +3342,7 @@ GList * freehand_shape_dropdown_items_list() { glist = g_list_append (glist, _("None")); glist = g_list_append (glist, _("Clipboard")); + glist = g_list_append (glist, _("Crescendo")); glist = g_list_append (glist, _("Decrescendo")); return glist; -- 2.30.2