summaryrefslogtreecommitdiffstats
path: root/src/livecode/context.cpp
diff options
context:
space:
mode:
authors-ol <s-ol@users.noreply.github.com>2019-12-09 13:25:38 +0000
committers-ol <s-ol@users.noreply.github.com>2019-12-09 13:25:38 +0000
commit192891fea7c9c78323147fd3c962a96d48f15001 (patch)
tree0d170ac5f6eb763f71c59b9a35c65feb497af55b /src/livecode/context.cpp
parentmove script to its own file (diff)
downloadinkscape-192891fea7c9c78323147fd3c962a96d48f15001.tar.gz
inkscape-192891fea7c9c78323147fd3c962a96d48f15001.zip
wip: create SVGs from Janet tableslivecoding
Diffstat (limited to 'src/livecode/context.cpp')
-rw-r--r--src/livecode/context.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/livecode/context.cpp b/src/livecode/context.cpp
index b63641411..040e23ac7 100644
--- a/src/livecode/context.cpp
+++ b/src/livecode/context.cpp
@@ -52,6 +52,15 @@ Context::~Context() {
}
}
+
+Inkscape::XML::Node *Context::createElement(gchar const *element) {
+ SPDocument *doc = desktop->getDocument();
+ Inkscape::XML::Document *xml_doc = doc->getReprDoc();
+
+ Inkscape::XML::Node *repr = xml_doc->createElement("svg:rect");
+ return repr;
+}
+
Inkscape::XML::Node *Context::make_rect(Geom::Rect const &rect, SPCSSAttr *css) {
SPDocument *doc = desktop->getDocument();
Inkscape::XML::Document *xml_doc = doc->getReprDoc();
@@ -283,19 +292,18 @@ void Context::setup_frame() {
Inkscape::GC::release(rdoc);
ui_root = SP_ITEM(desktop->currentLayer()->appendChildRepr(rui));
- ui_root->doWriteTransform(ui2doc(), nullptr, true);
+ doc_root->updateRepr();
Inkscape::GC::release(rui);
}
void Context::finish_frame() {
doc_root->updateRepr();
- ui_root->updateRepr();
+ ui_root->doWriteTransform(ui2doc(), nullptr, true);
_mouse.finish_frame();
}
void Context::load_script(Glib::ustring const &path) {
g_message("loading script %s", path.c_str());
- _script = nullptr;
try {
_script.reset(new Script(env, path));