diff --git a/src/shape-editor.cpp b/src/shape-editor.cpp
index 6cf1182ee0aedb92e71a76a920cb402cfc76716d..04f40929bec2cbfd328b89ee199d59b8d8234ab4 100644 (file)
--- a/src/shape-editor.cpp
+++ b/src/shape-editor.cpp
#include "live_effects/parameter/pointparam-knotholder.h"
#include "nodepath.h"
#include "xml/node-event-vector.h"
-#include "prefs-utils.h"
+#include "preferences.h"
#include "object-edit.h"
#include "style.h"
#include "display/curve.h"
switch(type) {
case SH_NODEPATH:
if (SP_IS_LPE_ITEM(item)) {
- this->nodepath = sp_nodepath_new(desktop, item, (prefs_get_int_attribute("tools.nodes", "show_handles", 1) != 0));
+ Inkscape::Preferences *prefs = Inkscape::Preferences::get();
+ this->nodepath = sp_nodepath_new(desktop, item, (prefs->getBool("/tools/nodes/show_handles", true)));
}
if (this->nodepath) {
this->nodepath->shape_editor = this;
@@ -286,8 +287,9 @@ void ShapeEditor::set_item_lpe_path_parameter(SPItem *item, SPObject *lpeobject,
this->grab_node = -1;
if (lpeobject) {
+ Inkscape::Preferences *prefs = Inkscape::Preferences::get();
this->nodepath = sp_nodepath_new( desktop, lpeobject,
- (prefs_get_int_attribute("tools.nodes", "show_handles", 1) != 0),
+ (prefs->getInt("/tools/nodes/show_handles", true)),
key, item);
if (this->nodepath) {
this->nodepath->shape_editor = this;
delta = desktop->d2w(delta);
+ Inkscape::Preferences *prefs = Inkscape::Preferences::get();
double stroke_tolerance =
(( !SP_OBJECT_STYLE(item)->stroke.isNone() ?
desktop->current_zoom() *
SP_OBJECT_STYLE (item)->stroke_width.computed * 0.5 *
- NR::expansion(sp_item_i2d_affine(item))
+ to_2geom(sp_item_i2d_affine(item)).descrim()
: 0.0)
- + prefs_get_int_attribute_limited("options.dragtolerance", "value", 0, 0, 100)) /NR::expansion(sp_item_i2d_affine(item));
- bool close = (NR::L2 (delta) < stroke_tolerance);
+ + prefs->getIntLimited("/options/dragtolerance/value", 0, 0, 100)) / to_2geom(sp_item_i2d_affine(item)).descrim();
+ bool close = (Geom::L2 (delta) < stroke_tolerance);
if (remember && close) {
// calculate index for nodepath's representation.
}
}
-void ShapeEditor::select_rect(NR::Rect const &rect, bool add) {
+void ShapeEditor::select_rect(Geom::Rect const &rect, bool add) {
if (this->nodepath) {
sp_nodepath_select_rect(this->nodepath, rect, add);
}