From: glimmer07 Date: Mon, 17 Aug 2009 19:05:00 +0000 (+0000) Subject: Fixed document_interface_line X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=0edb5724a18d57406606f3a54d9fcfa494506c27;p=inkscape.git Fixed document_interface_line (Warning: I don't know why it works this way, it just does.) --- diff --git a/src/extension/dbus/Notes.txt b/src/extension/dbus/Notes.txt index d7c34aac0..25c3f35b5 100644 --- a/src/extension/dbus/Notes.txt +++ b/src/extension/dbus/Notes.txt @@ -61,7 +61,6 @@ BUGS: *The following do not behave like the documentation: -document_interface_transform -document_interface_text - -document_interface_line EFFICIENCY: *Need better way to retrieve objects by name. diff --git a/src/extension/dbus/document-interface.cpp b/src/extension/dbus/document-interface.cpp index 05dd2925e..ff691bab6 100644 --- a/src/extension/dbus/document-interface.cpp +++ b/src/extension/dbus/document-interface.cpp @@ -449,16 +449,14 @@ document_interface_ellipse (DocumentInterface *object, int x, int y, return document_interface_ellipse_center (object, x+rx, y+ry, rx, ry, error); } -/* FIXME: makes line but gets one endpoint wrong.*/ gchar* document_interface_line (DocumentInterface *object, int x, int y, int x2, int y2, GError **error) { Inkscape::XML::Node *newNode = dbus_create_node(object->desk, "svg:path"); std::stringstream out; - printf("X2: %d\nY2 %d\n", x2, y2); - out << "m " << x << "," << y << " " << x2 << "," << y2; - printf ("PATH: %s\n", out.str().c_str()); + // Not sure why this works. + out << "m " << x << "," << y << " " << x2 - x << "," << y2 - y; newNode->setAttribute("d", out.str().c_str()); return finish_create_shape (object, error, newNode, (gchar *)"create line"); }