summaryrefslogtreecommitdiffstats
path: root/src/ui
diff options
context:
space:
mode:
authorLiam P. White <inkscapebrony@gmail.com>2014-11-26 01:10:30 +0000
committerLiam P. White <inkscapebrony@gmail.com>2014-11-26 01:10:30 +0000
commit6c87088ed548a3da4388ea95bba82aea798c901a (patch)
treee4269aab0a32957163935ec6b828b25d00613d68 /src/ui
parentUpdate to trunk r13750 (diff)
parentAdd CMake file to find LCMS2 (diff)
downloadinkscape-6c87088ed548a3da4388ea95bba82aea798c901a.tar.gz
inkscape-6c87088ed548a3da4388ea95bba82aea798c901a.zip
Update to trunk r13766
(bzr r13341.5.24)
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/dialog/clonetiler.cpp4
-rw-r--r--src/ui/dialog/document-properties.cpp4
-rw-r--r--src/ui/dialog/export.cpp2
-rw-r--r--src/ui/dialog/guides.cpp4
-rw-r--r--src/ui/dialog/inkscape-preferences.cpp2
-rw-r--r--src/ui/dialog/livepatheffect-editor.cpp8
-rw-r--r--src/ui/dialog/transformation.cpp4
-rw-r--r--src/ui/tool/node.cpp10
-rw-r--r--src/ui/tools/arc-tool.cpp4
-rw-r--r--src/ui/tools/freehand-base.cpp2
-rw-r--r--src/ui/tools/pen-tool.cpp2
-rw-r--r--src/ui/tools/rect-tool.cpp4
-rw-r--r--src/ui/tools/spiral-tool.cpp2
-rw-r--r--src/ui/tools/star-tool.cpp2
-rw-r--r--src/ui/tools/text-tool.cpp4
-rw-r--r--src/ui/widget/page-sizer.cpp4
-rw-r--r--src/ui/widget/selected-style.cpp2
17 files changed, 34 insertions, 30 deletions
diff --git a/src/ui/dialog/clonetiler.cpp b/src/ui/dialog/clonetiler.cpp
index d538ea5c5..37881d4ae 100644
--- a/src/ui/dialog/clonetiler.cpp
+++ b/src/ui/dialog/clonetiler.cpp
@@ -1093,7 +1093,7 @@ CloneTiler::CloneTiler () :
// unitmenu
unit_menu = new Inkscape::UI::Widget::UnitMenu();
unit_menu->setUnitType(Inkscape::Util::UNIT_TYPE_LINEAR);
- unit_menu->setUnit(sp_desktop_namedview(SP_ACTIVE_DESKTOP)->doc_units->abbr);
+ unit_menu->setUnit(sp_desktop_namedview(SP_ACTIVE_DESKTOP)->display_units->abbr);
unitChangedConn = unit_menu->signal_changed().connect(sigc::mem_fun(*this, &CloneTiler::clonetiler_unit_changed));
{
@@ -2251,7 +2251,7 @@ void CloneTiler::clonetiler_apply(GtkWidget */*widget*/, GtkWidget *dlg)
clonetiler_remove (NULL, dlg, false);
- double scale_units = Inkscape::Util::Quantity::convert(1, "px", sp_desktop_document(desktop)->getDefaultUnit());
+ double scale_units = Inkscape::Util::Quantity::convert(1, "px", &sp_desktop_document(desktop)->getSVGUnit());
double shiftx_per_i = 0.01 * prefs->getDoubleLimited(prefs_path + "shiftx_per_i", 0, -10000, 10000);
double shifty_per_i = 0.01 * prefs->getDoubleLimited(prefs_path + "shifty_per_i", 0, -10000, 10000);
diff --git a/src/ui/dialog/document-properties.cpp b/src/ui/dialog/document-properties.cpp
index 084a1e98d..13ee8a6c6 100644
--- a/src/ui/dialog/document-properties.cpp
+++ b/src/ui/dialog/document-properties.cpp
@@ -1480,8 +1480,8 @@ void DocumentProperties::update()
_rcb_antialias.set_xml_target(root->getRepr(), dt->getDocument());
_rcb_antialias.setActive(root->style->shape_rendering.computed != SP_CSS_SHAPE_RENDERING_CRISPEDGES);
- if (nv->doc_units) {
- _rum_deflt.setUnit (nv->doc_units->abbr);
+ if (nv->display_units) {
+ _rum_deflt.setUnit (nv->display_units->abbr);
}
double doc_w = sp_desktop_document(dt)->getRoot()->width.value;
diff --git a/src/ui/dialog/export.cpp b/src/ui/dialog/export.cpp
index ba30c8e6b..1ebd1fc7c 100644
--- a/src/ui/dialog/export.cpp
+++ b/src/ui/dialog/export.cpp
@@ -206,7 +206,7 @@ Export::Export (void) :
SPDesktop *desktop = SP_ACTIVE_DESKTOP;
if (desktop) {
- unit_selector.setUnit(sp_desktop_namedview(desktop)->doc_units->abbr);
+ unit_selector.setUnit(sp_desktop_namedview(desktop)->display_units->abbr);
}
unitChangedConn = unit_selector.signal_changed().connect(sigc::mem_fun(*this, &Export::onUnitChanged));
unitbox.pack_end(unit_selector, false, false, 0);
diff --git a/src/ui/dialog/guides.cpp b/src/ui/dialog/guides.cpp
index 4519a905f..221f9a1c0 100644
--- a/src/ui/dialog/guides.cpp
+++ b/src/ui/dialog/guides.cpp
@@ -216,8 +216,8 @@ void GuidelinePropertiesDialog::_setup() {
/* fixme: We should allow percents here too, as percents of the canvas size */
_unit_menu.setUnitType(UNIT_TYPE_LINEAR);
_unit_menu.setUnit("px");
- if (_desktop->namedview->doc_units) {
- _unit_menu.setUnit( _desktop->namedview->doc_units->abbr );
+ if (_desktop->namedview->display_units) {
+ _unit_menu.setUnit( _desktop->namedview->display_units->abbr );
}
_spin_angle.setUnit(_angle_unit_status);
diff --git a/src/ui/dialog/inkscape-preferences.cpp b/src/ui/dialog/inkscape-preferences.cpp
index 87b698673..ed4b16008 100644
--- a/src/ui/dialog/inkscape-preferences.cpp
+++ b/src/ui/dialog/inkscape-preferences.cpp
@@ -461,7 +461,7 @@ void InkscapePreferences::initPageTools()
_page_text.add_line( false, _("Text size unit type:"), _font_unit_type, "",
_("Set the type of unit used in the text toolbar and text dialogs"), false);
_font_output_px.init ( _("Always output text size in pixels (px)"), "/options/font/textOutputPx", true);
- _page_text.add_line( false, "", _font_output_px, "", _("Always convert the text size units above into pixels (px) before saving to file"));
+// _page_text.add_line( false, "", _font_output_px, "", _("Always convert the text size units above into pixels (px) before saving to file"));
this->AddNewObjectsStyle(_page_text, "/tools/text");
diff --git a/src/ui/dialog/livepatheffect-editor.cpp b/src/ui/dialog/livepatheffect-editor.cpp
index eb3857ee7..178c32c38 100644
--- a/src/ui/dialog/livepatheffect-editor.cpp
+++ b/src/ui/dialog/livepatheffect-editor.cpp
@@ -475,9 +475,13 @@ LivePathEffectEditor::onAdd()
// run sp_selection_clone_original_path_lpe
sp_selection_clone_original_path_lpe(current_desktop);
+
SPItem *new_item = sel->singleItem();
- new_item->getRepr()->setAttribute("id", id);
- new_item->getRepr()->setAttribute("transform", transform);
+ // Check that the cloning was successful. We don't want to change the ID of the original referenced path!
+ if (new_item && (new_item != orig)) {
+ new_item->getRepr()->setAttribute("id", id);
+ new_item->getRepr()->setAttribute("transform", transform);
+ }
g_free(id);
g_free(transform);
diff --git a/src/ui/dialog/transformation.cpp b/src/ui/dialog/transformation.cpp
index 43f0e8683..2c6692777 100644
--- a/src/ui/dialog/transformation.cpp
+++ b/src/ui/dialog/transformation.cpp
@@ -206,8 +206,8 @@ void Transformation::layoutPageMove()
// Setting default unit to document unit
SPDesktop *dt = getDesktop();
SPNamedView *nv = sp_desktop_namedview(dt);
- if (nv->doc_units) {
- _units_move.setUnit(nv->doc_units->abbr);
+ if (nv->display_units) {
+ _units_move.setUnit(nv->display_units->abbr);
}
_scalar_move_horizontal.initScalar(-1e6, 1e6);
diff --git a/src/ui/tool/node.cpp b/src/ui/tool/node.cpp
index 8a1ca0b90..8c22f7c6e 100644
--- a/src/ui/tool/node.cpp
+++ b/src/ui/tool/node.cpp
@@ -566,9 +566,9 @@ Glib::ustring Handle::_getDragTip(GdkEventMotion */*event*/) const
Inkscape::Util::Quantity x_q = Inkscape::Util::Quantity(dist[Geom::X], "px");
Inkscape::Util::Quantity y_q = Inkscape::Util::Quantity(dist[Geom::Y], "px");
Inkscape::Util::Quantity len_q = Inkscape::Util::Quantity(length(), "px");
- GString *x = g_string_new(x_q.string(_desktop->namedview->doc_units).c_str());
- GString *y = g_string_new(y_q.string(_desktop->namedview->doc_units).c_str());
- GString *len = g_string_new(len_q.string(_desktop->namedview->doc_units).c_str());
+ GString *x = g_string_new(x_q.string(_desktop->namedview->display_units).c_str());
+ GString *y = g_string_new(y_q.string(_desktop->namedview->display_units).c_str());
+ GString *len = g_string_new(len_q.string(_desktop->namedview->display_units).c_str());
Glib::ustring ret = format_tip(C_("Path handle tip",
"Move handle by %s, %s; angle %.2f°, length %s"), x->str, y->str, angle, len->str);
g_string_free(x, TRUE);
@@ -1490,8 +1490,8 @@ Glib::ustring Node::_getDragTip(GdkEventMotion */*event*/) const
Inkscape::Util::Quantity x_q = Inkscape::Util::Quantity(dist[Geom::X], "px");
Inkscape::Util::Quantity y_q = Inkscape::Util::Quantity(dist[Geom::Y], "px");
- GString *x = g_string_new(x_q.string(_desktop->namedview->doc_units).c_str());
- GString *y = g_string_new(y_q.string(_desktop->namedview->doc_units).c_str());
+ GString *x = g_string_new(x_q.string(_desktop->namedview->display_units).c_str());
+ GString *y = g_string_new(y_q.string(_desktop->namedview->display_units).c_str());
Glib::ustring ret = format_tip(C_("Path node tip", "Move node by %s, %s"), x->str, y->str);
g_string_free(x, TRUE);
g_string_free(y, TRUE);
diff --git a/src/ui/tools/arc-tool.cpp b/src/ui/tools/arc-tool.cpp
index 4f64ade25..9c3195a42 100644
--- a/src/ui/tools/arc-tool.cpp
+++ b/src/ui/tools/arc-tool.cpp
@@ -405,8 +405,8 @@ void ArcTool::drag(Geom::Point pt, guint state) {
Inkscape::Util::Quantity rdimx_q = Inkscape::Util::Quantity(rdimx, "px");
Inkscape::Util::Quantity rdimy_q = Inkscape::Util::Quantity(rdimy, "px");
- GString *xs = g_string_new(rdimx_q.string(desktop->namedview->doc_units).c_str());
- GString *ys = g_string_new(rdimy_q.string(desktop->namedview->doc_units).c_str());
+ GString *xs = g_string_new(rdimx_q.string(desktop->namedview->display_units).c_str());
+ GString *ys = g_string_new(rdimy_q.string(desktop->namedview->display_units).c_str());
if (state & GDK_CONTROL_MASK) {
int ratio_x, ratio_y;
diff --git a/src/ui/tools/freehand-base.cpp b/src/ui/tools/freehand-base.cpp
index bd84e0efb..32702a17e 100644
--- a/src/ui/tools/freehand-base.cpp
+++ b/src/ui/tools/freehand-base.cpp
@@ -256,7 +256,7 @@ static void spdc_apply_powerstroke_shape(const std::vector<Geom::Point> & points
std::ostringstream s;
s.imbue(std::locale::classic());
- s << "0," << stroke_width / 2.;
+ s << points[0][Geom::X] << "," << stroke_width / 2.;
// write powerstroke parameters:
lpe->getRepr()->setAttribute("start_linecap_type", "zerowidth");
diff --git a/src/ui/tools/pen-tool.cpp b/src/ui/tools/pen-tool.cpp
index 92937a135..fbcdf6142 100644
--- a/src/ui/tools/pen-tool.cpp
+++ b/src/ui/tools/pen-tool.cpp
@@ -1366,7 +1366,7 @@ void PenTool::_setAngleDistanceStatusMessage(Geom::Point const p, int pc_point_t
Geom::Point rel = p - this->p[pc_point_to_compare];
Inkscape::Util::Quantity q = Inkscape::Util::Quantity(Geom::L2(rel), "px");
- GString *dist = g_string_new(q.string(desktop->namedview->doc_units).c_str());
+ GString *dist = g_string_new(q.string(desktop->namedview->display_units).c_str());
double angle = atan2(rel[Geom::Y], rel[Geom::X]) * 180 / M_PI;
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
if (prefs->getBool("/options/compassangledisplay/value", 0) != 0) {
diff --git a/src/ui/tools/rect-tool.cpp b/src/ui/tools/rect-tool.cpp
index de91dcff4..67df0d9a5 100644
--- a/src/ui/tools/rect-tool.cpp
+++ b/src/ui/tools/rect-tool.cpp
@@ -422,8 +422,8 @@ void RectTool::drag(Geom::Point const pt, guint state) {
Inkscape::Util::Quantity rdimx_q = Inkscape::Util::Quantity(rdimx, "px");
Inkscape::Util::Quantity rdimy_q = Inkscape::Util::Quantity(rdimy, "px");
- GString *xs = g_string_new(rdimx_q.string(desktop->namedview->doc_units).c_str());
- GString *ys = g_string_new(rdimy_q.string(desktop->namedview->doc_units).c_str());
+ GString *xs = g_string_new(rdimx_q.string(desktop->namedview->display_units).c_str());
+ GString *ys = g_string_new(rdimy_q.string(desktop->namedview->display_units).c_str());
if (state & GDK_CONTROL_MASK) {
int ratio_x, ratio_y;
diff --git a/src/ui/tools/spiral-tool.cpp b/src/ui/tools/spiral-tool.cpp
index 18c3e4e2d..31c4e8829 100644
--- a/src/ui/tools/spiral-tool.cpp
+++ b/src/ui/tools/spiral-tool.cpp
@@ -395,7 +395,7 @@ void SpiralTool::drag(Geom::Point const &p, guint state) {
/* status text */
Inkscape::Util::Quantity q = Inkscape::Util::Quantity(rad, "px");
- GString *rads = g_string_new(q.string(desktop->namedview->doc_units).c_str());
+ GString *rads = g_string_new(q.string(desktop->namedview->display_units).c_str());
this->message_context->setF(Inkscape::IMMEDIATE_MESSAGE,
_("<b>Spiral</b>: radius %s, angle %5g&#176;; with <b>Ctrl</b> to snap angle"),
rads->str, sp_round((arg + 2.0*M_PI*this->spiral->revo)*180/M_PI, 0.0001));
diff --git a/src/ui/tools/star-tool.cpp b/src/ui/tools/star-tool.cpp
index 7604ba04e..b5544d263 100644
--- a/src/ui/tools/star-tool.cpp
+++ b/src/ui/tools/star-tool.cpp
@@ -411,7 +411,7 @@ void StarTool::drag(Geom::Point p, guint state)
/* status text */
Inkscape::Util::Quantity q = Inkscape::Util::Quantity(r1, "px");
- GString *rads = g_string_new(q.string(desktop->namedview->doc_units).c_str());
+ GString *rads = g_string_new(q.string(desktop->namedview->display_units).c_str());
this->message_context->setF(Inkscape::IMMEDIATE_MESSAGE,
( this->isflatsided?
_("<b>Polygon</b>: radius %s, angle %5g&#176;; with <b>Ctrl</b> to snap angle")
diff --git a/src/ui/tools/text-tool.cpp b/src/ui/tools/text-tool.cpp
index a72748733..578add843 100644
--- a/src/ui/tools/text-tool.cpp
+++ b/src/ui/tools/text-tool.cpp
@@ -590,8 +590,8 @@ bool TextTool::root_handler(GdkEvent* event) {
// status text
Inkscape::Util::Quantity x_q = Inkscape::Util::Quantity(fabs((p - this->p0)[Geom::X]), "px");
Inkscape::Util::Quantity y_q = Inkscape::Util::Quantity(fabs((p - this->p0)[Geom::Y]), "px");
- GString *xs = g_string_new(x_q.string(desktop->namedview->doc_units).c_str());
- GString *ys = g_string_new(y_q.string(desktop->namedview->doc_units).c_str());
+ GString *xs = g_string_new(x_q.string(desktop->namedview->display_units).c_str());
+ GString *ys = g_string_new(y_q.string(desktop->namedview->display_units).c_str());
this->message_context->setF(Inkscape::IMMEDIATE_MESSAGE, _("<b>Flowed text frame</b>: %s &#215; %s"), xs->str, ys->str);
g_string_free(xs, FALSE);
diff --git a/src/ui/widget/page-sizer.cpp b/src/ui/widget/page-sizer.cpp
index 32e357c57..b775b3c49 100644
--- a/src/ui/widget/page-sizer.cpp
+++ b/src/ui/widget/page-sizer.cpp
@@ -313,8 +313,8 @@ PageSizer::PageSizer(Registry & _wr)
_wr.setUpdating (true);
if (nv->page_size_units) {
_dimensionUnits.setUnit(nv->page_size_units->abbr);
- } else if (nv->doc_units) {
- _dimensionUnits.setUnit(nv->doc_units->abbr);
+ } else if (nv->display_units) {
+ _dimensionUnits.setUnit(nv->display_units->abbr);
}
_wr.setUpdating (false);
diff --git a/src/ui/widget/selected-style.cpp b/src/ui/widget/selected-style.cpp
index d22c59aa4..aebef2c4e 100644
--- a/src/ui/widget/selected-style.cpp
+++ b/src/ui/widget/selected-style.cpp
@@ -498,7 +498,7 @@ SelectedStyle::setDesktop(SPDesktop *desktop)
this )
));
- _sw_unit = sp_desktop_namedview(desktop)->doc_units;
+ _sw_unit = sp_desktop_namedview(desktop)->display_units;
// Set the doc default unit active in the units list
gint length = g_slist_length(_unit_mis);