From 0afd549c4559664e33bab5d20ccdeca2ae39026f Mon Sep 17 00:00:00 2001 From: Maximilian Albert Date: Sat, 19 Jan 2008 23:31:25 +0000 Subject: Make creation of dots via Ctrl+click also possible in pen context; fill dots with current stroke color (and unset stroke); add preferences settings for dot radius and status bar messages; Shift+Ctrl+click varies the radius slightly (bzr r4563) --- src/pencil-context.cpp | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) (limited to 'src/pencil-context.cpp') diff --git a/src/pencil-context.cpp b/src/pencil-context.cpp index f17337183..691dcb098 100644 --- a/src/pencil-context.cpp +++ b/src/pencil-context.cpp @@ -229,28 +229,9 @@ pencil_handle_button_press(SPPencilContext *const pc, GdkEventButton const &beve default: /* Set first point of sequence */ if (bevent.state & GDK_CONTROL_MASK) { - /* Create object */ - Inkscape::XML::Document *xml_doc = sp_document_repr_doc(desktop->doc()); - Inkscape::XML::Node *repr = xml_doc->createElement("svg:path"); - repr->setAttribute("sodipodi:type", "arc"); - SPItem *item = SP_ITEM(desktop->currentLayer()->appendChildRepr(repr)); - Inkscape::GC::release(repr); - NR::Matrix const i2d (sp_item_i2d_affine (item)); - NR::Point pp = p * i2d; - sp_repr_set_svg_double (repr, "sodipodi:cx", pp[NR::X]); - sp_repr_set_svg_double (repr, "sodipodi:cy", pp[NR::Y]); - sp_repr_set_int (repr, "sodipodi:rx", 10); - sp_repr_set_int (repr, "sodipodi:ry", 10); - - /* Set style */ - sp_desktop_apply_style_tool(desktop, repr, "tools.shapes.arc", false); - - item->updateRepr(); - desktop->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("Creating single point")); - sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_PENCIL, _("Create single point")); + freehand_create_single_dot(event_context, p, "tools.freehand.pencil", bevent.state & GDK_SHIFT_MASK); ret = true; break; - } if (anchor) { p = anchor->dp; -- cgit v1.2.3