Commit 53183233 authored by Nathan Lee's avatar Nathan Lee

Fix dot creation size with varying units (#854)

(cherry picked from db810f5b)
parent 8da66828
......@@ -936,6 +936,7 @@ void spdc_create_single_dot(ToolBase *ec, Geom::Point const &pt, char const *too
Inkscape::XML::Node *repr = xml_doc->createElement("svg:path");
repr->setAttribute("sodipodi:type", "arc");
SPItem *item = SP_ITEM(desktop->currentLayer()->appendChildRepr(repr));
item->transform = SP_ITEM(desktop->currentLayer())->i2doc_affine().inverse();
Inkscape::GC::release(repr);
// apply the tool's current style
......@@ -962,6 +963,7 @@ void spdc_create_single_dot(ToolBase *ec, Geom::Point const &pt, char const *too
Geom::Affine const i2d (item->i2dt_affine ());
Geom::Point pp = pt * i2d.inverse();
double rad = 0.5 * prefs->getDouble(tool_path + "/dot-size", 3.0);
if (event_state & GDK_MOD1_MASK) {
// TODO: We vary the dot size between 0.5*rad and 1.5*rad, where rad is the dot size
......@@ -980,6 +982,7 @@ void spdc_create_single_dot(ToolBase *ec, Geom::Point const &pt, char const *too
sp_repr_set_svg_double (repr, "sodipodi:rx", rad * stroke_width);
sp_repr_set_svg_double (repr, "sodipodi:ry", rad * stroke_width);
item->updateRepr();
item->doWriteTransform(repr, item->transform);
desktop->getSelection()->set(item);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment