Code

Add new shape 'crescendo' in dropdown box of pen tool
authorcilix42 <cilix42@users.sourceforge.net>
Thu, 3 Jul 2008 09:40:42 +0000 (09:40 +0000)
committercilix42 <cilix42@users.sourceforge.net>
Thu, 3 Jul 2008 09:40:42 +0000 (09:40 +0000)
src/draw-context.cpp
src/widgets/toolbox.cpp

index 92bba8104f339587fc23ef8affef3b7a46d6fffa..c40ea1991cb1081af179d5a4b2a6e7ef3f4f71a6 100644 (file)
@@ -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<LPEPatternAlongPath*>(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;
index 8fa52c2815ab29a01a8f8e8db5101c99027a09a7..148694ef98f6f77997a93dcaeb98323364bc815f 100644 (file)
@@ -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;