summaryrefslogtreecommitdiffstats
path: root/src/dyna-draw-context.cpp
diff options
context:
space:
mode:
authorJon A. Cruz <jon@joncruz.org>2010-12-12 08:40:34 +0000
committerJon A. Cruz <jon@joncruz.org>2010-12-12 08:40:34 +0000
commitaadfea4113abc6863d7ab03d21b973802c41c503 (patch)
tree3f890c0c112433fd850d59558208addf1baa85da /src/dyna-draw-context.cpp
parentPot and Dutch translation update (diff)
parentA simple layout document as to what, why and how is cppification. (diff)
downloadinkscape-aadfea4113abc6863d7ab03d21b973802c41c503.tar.gz
inkscape-aadfea4113abc6863d7ab03d21b973802c41c503.zip
Merge and cleanup of GSoC C++-ification project.
(bzr r9945.1.1)
Diffstat (limited to 'src/dyna-draw-context.cpp')
-rw-r--r--src/dyna-draw-context.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/dyna-draw-context.cpp b/src/dyna-draw-context.cpp
index 98f57b5bc..93d4262cd 100644
--- a/src/dyna-draw-context.cpp
+++ b/src/dyna-draw-context.cpp
@@ -1,5 +1,3 @@
-#define __SP_DYNA_DRAW_CONTEXT_C__
-
/*
* Handwriting-like drawing mode
*
@@ -8,6 +6,7 @@
* Lauris Kaplinski <lauris@kaplinski.com>
* bulia byak <buliabyak@users.sf.net>
* MenTaLguY <mental@rydia.net>
+ * Abhishek Sharma
*
* The original dynadraw code:
* Paul Haeberli <paul@sgi.com>
@@ -65,6 +64,8 @@
#include "dyna-draw-context.h"
+using Inkscape::DocumentUndo;
+
#define DDC_RED_RGBA 0xff0000ff
#define TOLERANCE_CALLIGRAPHIC 0.1
@@ -599,7 +600,7 @@ sp_dyna_draw_context_root_handler(SPEventContext *event_context,
}
// calculate pointer point in the guide item's coords
- motion_to_curve = sp_item_dt2i_affine(selected) * sp_item_i2doc_affine(selected);
+ motion_to_curve = selected->dt2i_affine() * selected->i2doc_affine();
pointer = motion_dt * motion_to_curve;
// calculate the nearest point on the guide path
@@ -1002,7 +1003,7 @@ set_to_accumulated(SPDynaDrawContext *dc, bool unionize, bool subtract)
if (!dc->accumulated->is_empty()) {
if (!dc->repr) {
/* Create object */
- Inkscape::XML::Document *xml_doc = sp_document_repr_doc(desktop->doc());
+ Inkscape::XML::Document *xml_doc = desktop->doc()->getReprDoc();
Inkscape::XML::Node *repr = xml_doc->createElement("svg:path");
/* Set style */
@@ -1012,7 +1013,7 @@ set_to_accumulated(SPDynaDrawContext *dc, bool unionize, bool subtract)
SPItem *item=SP_ITEM(desktop->currentLayer()->appendChildRepr(dc->repr));
Inkscape::GC::release(dc->repr);
- item->transform = sp_item_i2doc_affine(SP_ITEM(desktop->currentLayer())).inverse();
+ item->transform = SP_ITEM(desktop->currentLayer())->i2doc_affine().inverse();
item->updateRepr();
}
Geom::PathVector pathv = dc->accumulated->get_pathvector() * desktop->dt2doc();
@@ -1040,8 +1041,8 @@ set_to_accumulated(SPDynaDrawContext *dc, bool unionize, bool subtract)
dc->repr = NULL;
}
- sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_CALLIGRAPHIC,
- _("Draw calligraphic stroke"));
+ DocumentUndo::done(sp_desktop_document(desktop), SP_VERB_CONTEXT_CALLIGRAPHIC,
+ _("Draw calligraphic stroke"));
}
static void