~valavanisalex/ubuntu/oneiric/inkscape/inkscape_0.48.1-2ubuntu4

« back to all changes in this revision

Viewing changes to src/shape-editor.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Kees Cook, Ted Gould, Kees Cook
  • Date: 2009-06-24 14:00:43 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20090624140043-07stp20mry48hqup
Tags: 0.47~pre0-0ubuntu1
* New upstream release

[ Ted Gould ]
* debian/control: Adding libgsl0 and removing version specifics on boost

[ Kees Cook ]
* debian/watch: updated to run uupdate and mangle pre-release versions.
* Dropped patches that have been taken upstream:
  - 01_mips
  - 02-poppler-0.8.3
  - 03-chinese-inkscape
  - 05_fix_latex_patch
  - 06_gcc-4.4
  - 07_cdr2svg
  - 08_skip-bad-utf-on-pdf-import
  - 09_gtk-clist
  - 10_belarussian
  - 11_libpng
  - 12_desktop
  - 13_slider
  - 100_svg_import_improvements
  - 102_sp_pattern_painter_free
  - 103_bitmap_type_print

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
#include "live_effects/lpeobject.h"
21
21
#include "selection.h"
22
22
#include "desktop.h"
 
23
#include "document.h"
23
24
#include "desktop-handles.h"
24
25
#include "knotholder.h"
25
 
#include "node-context.h"
 
26
#include "live_effects/parameter/point.h"
 
27
#include "nodepath.h"
26
28
#include "xml/node-event-vector.h"
27
 
#include "prefs-utils.h"
 
29
#include "preferences.h"
28
30
#include "object-edit.h"
29
 
#include "splivarot.h"
30
31
#include "style.h"
 
32
#include "display/curve.h"
 
33
#include <2geom/pathvector.h>
31
34
 
32
35
#include "shape-editor.h"
33
36
 
51
54
    this->nodepath = NULL;
52
55
    this->knotholder = NULL;
53
56
    this->hit = false;
 
57
    this->listener_attached_for = NULL;
54
58
}
55
59
 
56
60
ShapeEditor::~ShapeEditor() {
57
 
    unset_item();
 
61
    unset_item(SH_KNOTHOLDER);
 
62
    unset_item(SH_NODEPATH);
58
63
}
59
64
 
60
 
void ShapeEditor::unset_item() {
61
 
 
 
65
void ShapeEditor::unset_item(SubType type, bool keep_knotholder) {
62
66
    Inkscape::XML::Node *old_repr = NULL;
63
67
 
64
 
    if (this->nodepath) {
65
 
        old_repr = this->nodepath->repr;
66
 
    }
67
 
 
68
 
    if (!old_repr && this->knotholder) {
69
 
        old_repr = this->knotholder->repr;
70
 
    }
71
 
 
72
 
    if (old_repr) { // remove old listener
73
 
        sp_repr_remove_listener_by_data(old_repr, this);
74
 
        Inkscape::GC::release(old_repr);
75
 
    }
76
 
 
77
 
    if (this->nodepath) {
78
 
        this->grab_node = -1;
79
 
        sp_nodepath_destroy(this->nodepath);
80
 
        this->nodepath = NULL;
81
 
    }
82
 
 
83
 
    if (this->knotholder) {
84
 
        sp_knot_holder_destroy(this->knotholder);
85
 
        this->knotholder = NULL;
 
68
    switch (type) {
 
69
        case SH_NODEPATH:
 
70
            if (this->nodepath) {
 
71
                old_repr = this->nodepath->repr;
 
72
                if (old_repr && old_repr == listener_attached_for) {
 
73
                    sp_repr_remove_listener_by_data(old_repr, this);
 
74
                    Inkscape::GC::release(old_repr);
 
75
                    listener_attached_for = NULL;
 
76
                }
 
77
 
 
78
                this->grab_node = -1;
 
79
                delete this->nodepath;
 
80
                this->nodepath = NULL;
 
81
            }
 
82
            break;
 
83
        case SH_KNOTHOLDER:
 
84
            if (this->knotholder) {
 
85
                old_repr = this->knotholder->repr;
 
86
                if (old_repr && old_repr == listener_attached_for) {
 
87
                    sp_repr_remove_listener_by_data(old_repr, this);
 
88
                    Inkscape::GC::release(old_repr);
 
89
                    listener_attached_for = NULL;
 
90
                }
 
91
 
 
92
                if (!keep_knotholder) {
 
93
                    delete this->knotholder;
 
94
                    this->knotholder = NULL;
 
95
                }
 
96
            }
 
97
            break;
86
98
    }
87
99
}
88
100
 
94
106
    return (this->knotholder != NULL);
95
107
}
96
108
 
97
 
bool ShapeEditor::has_local_change () {
98
 
    if (this->nodepath)
99
 
        return (this->nodepath->local_change != 0);
100
 
    else if (this->knotholder)
101
 
        return (this->knotholder->local_change != 0);
102
 
    else
103
 
        return false;
104
 
}
105
 
 
106
 
void ShapeEditor::decrement_local_change () {
107
 
    if (this->nodepath) {
108
 
        if (this->nodepath->local_change > 0)
109
 
            this->nodepath->local_change--;
110
 
    } else if (this->knotholder) {
111
 
        this->knotholder->local_change = FALSE;
112
 
    }
113
 
}
114
 
 
115
 
SPItem *ShapeEditor::get_item () {
116
 
    SPItem *item = NULL;
117
 
    if (this->has_nodepath()) {
118
 
        item = this->nodepath->item;
119
 
    } else if (this->has_knotholder()) {
120
 
        item = SP_ITEM(this->knotholder->item);
 
109
void ShapeEditor::update_knotholder () {
 
110
    if (this->knotholder)
 
111
        this->knotholder->update_knots();
 
112
}
 
113
 
 
114
bool ShapeEditor::has_local_change (SubType type) {
 
115
    switch (type) {
 
116
        case SH_NODEPATH:
 
117
            return (this->nodepath && this->nodepath->local_change);
 
118
        case SH_KNOTHOLDER:
 
119
            return (this->knotholder && this->knotholder->local_change != 0);
 
120
        default:
 
121
            g_assert_not_reached();
 
122
    }
 
123
}
 
124
 
 
125
void ShapeEditor::decrement_local_change (SubType type) {
 
126
    switch (type) {
 
127
        case SH_NODEPATH:
 
128
            if (this->nodepath && this->nodepath->local_change > 0) {
 
129
                this->nodepath->local_change--;
 
130
            }
 
131
            break;
 
132
        case SH_KNOTHOLDER:
 
133
            if (this->knotholder) {
 
134
                this->knotholder->local_change = FALSE;
 
135
            }
 
136
            break;
 
137
        default:
 
138
            g_assert_not_reached();
 
139
    }
 
140
}
 
141
 
 
142
const SPItem *ShapeEditor::get_item (SubType type) {
 
143
    const SPItem *item = NULL;
 
144
    switch (type) {
 
145
        case SH_NODEPATH:
 
146
            if (this->has_nodepath()) {
 
147
                item = this->nodepath->item;
 
148
            }
 
149
            break;
 
150
        case SH_KNOTHOLDER:
 
151
            if (this->has_knotholder()) {
 
152
                item = this->knotholder->getItem();
 
153
            }
 
154
            break;
121
155
    }
122
156
    return item;
123
157
}
141
175
    return false;
142
176
}
143
177
 
 
178
 
 
179
void ShapeEditor::shapeeditor_event_attr_changed(gchar const *name)
 
180
{
 
181
    gboolean changed_np = FALSE;
 
182
    gboolean changed_kh = FALSE;
 
183
 
 
184
    if (has_nodepath() && nodepath_edits_repr_key(name))
 
185
    {
 
186
        changed_np = !has_local_change(SH_NODEPATH);
 
187
        decrement_local_change(SH_NODEPATH);
 
188
    }
 
189
 
 
190
    if (changed_np) {
 
191
        GList *saved = NULL;
 
192
        if (has_nodepath()) {
 
193
            saved = save_nodepath_selection();
 
194
        }
 
195
 
 
196
        reset_item(SH_NODEPATH);
 
197
 
 
198
        if (has_nodepath() && saved) {
 
199
            restore_nodepath_selection(saved);
 
200
            g_list_free (saved);
 
201
        }
 
202
    }
 
203
 
 
204
    if (has_knotholder())
 
205
    {
 
206
        changed_kh = !has_local_change(SH_KNOTHOLDER);
 
207
        decrement_local_change(SH_KNOTHOLDER);
 
208
        if (changed_kh) {
 
209
            // this can happen if an LPEItem's knotholder handle was dragged, in which case we want
 
210
            // to keep the knotholder; in all other cases (e.g., if the LPE itself changes) we delete it
 
211
            reset_item(SH_KNOTHOLDER, !strcmp(name, "d"));
 
212
        }
 
213
    }
 
214
 
 
215
    update_statusbar(); //TODO: get_container()->update_statusbar();
 
216
}
 
217
 
 
218
 
144
219
static void shapeeditor_event_attr_changed(Inkscape::XML::Node */*repr*/, gchar const *name,
145
220
                                           gchar const */*old_value*/, gchar const */*new_value*/,
146
221
                                           bool /*is_interactive*/, gpointer data)
147
222
{
148
 
    gboolean changed = FALSE;
149
 
 
150
223
    g_assert(data);
151
224
    ShapeEditor *sh = ((ShapeEditor *) data);
152
225
 
153
 
    if ( sh->has_knotholder() || ( sh->has_nodepath() && sh->nodepath_edits_repr_key(name) ) )
154
 
    {
155
 
        changed = !sh->has_local_change();
156
 
        sh->decrement_local_change();
157
 
    }
158
 
 
159
 
    if (changed) {
160
 
        GList *saved = NULL;
161
 
        if (sh->has_nodepath()) {
162
 
            saved = sh->save_nodepath_selection();
163
 
        }
164
 
 
165
 
        sh->reset_item ();
166
 
 
167
 
        if (sh->has_nodepath() && saved) {
168
 
            sh->restore_nodepath_selection(saved);
169
 
            g_list_free (saved);
170
 
        }
171
 
    }
172
 
 
173
 
    sh->update_statusbar(); //TODO: sh->get_container()->update_statusbar();
 
226
    sh->shapeeditor_event_attr_changed(name);
174
227
}
175
228
 
176
229
static Inkscape::XML::NodeEventVector shapeeditor_repr_events = {
182
235
};
183
236
 
184
237
 
185
 
void ShapeEditor::set_item(SPItem *item) {
186
 
 
187
 
    unset_item();
 
238
void ShapeEditor::set_item(SPItem *item, SubType type, bool keep_knotholder) {
 
239
    // this happens (and should only happen) when for an LPEItem having both knotholder and
 
240
    // nodepath the knotholder is adapted; in this case we don't want to delete the knotholder
 
241
    // since this freezes the handles
 
242
    unset_item(type, keep_knotholder);
188
243
 
189
244
    this->grab_node = -1;
190
245
 
191
246
    if (item) {
192
 
        this->nodepath = sp_nodepath_new(desktop, item, (prefs_get_int_attribute("tools.nodes", "show_handles", 1) != 0));
193
 
        if (this->nodepath) {
194
 
            this->nodepath->shape_editor = this;
195
 
        }
196
 
        this->knotholder = sp_item_knot_holder(item, desktop);
197
 
 
198
 
        if (this->nodepath || this->knotholder) {
199
 
            // setting new listener
200
 
            Inkscape::XML::Node *repr;
201
 
            if (this->knotholder)
202
 
                repr = this->knotholder->repr;
203
 
            else
204
 
                repr = SP_OBJECT_REPR(item);
205
 
            if (repr) {
206
 
                Inkscape::GC::anchor(repr);
207
 
                sp_repr_add_listener(repr, &shapeeditor_repr_events, this);
208
 
            }
 
247
        Inkscape::XML::Node *repr;
 
248
        switch(type) {
 
249
            case SH_NODEPATH:
 
250
                if (SP_IS_LPE_ITEM(item)) {
 
251
                    Inkscape::Preferences *prefs = Inkscape::Preferences::get();
 
252
                    this->nodepath = sp_nodepath_new(desktop, item, (prefs->getBool("/tools/nodes/show_handles", true)));
 
253
                }
 
254
                if (this->nodepath) {
 
255
                    this->nodepath->shape_editor = this;
 
256
 
 
257
                    // setting new listener
 
258
                    repr = SP_OBJECT_REPR(item);
 
259
                    if (repr != listener_attached_for) {
 
260
                        Inkscape::GC::anchor(repr);
 
261
                        sp_repr_add_listener(repr, &shapeeditor_repr_events, this);
 
262
                        listener_attached_for = repr;
 
263
                    }
 
264
                }
 
265
                break;
 
266
 
 
267
            case SH_KNOTHOLDER:
 
268
                if (!this->knotholder) {
 
269
                    // only recreate knotholder if none is present
 
270
                    this->knotholder = sp_item_knot_holder(item, desktop);
 
271
                }
 
272
                if (this->knotholder) {
 
273
                    this->knotholder->update_knots();
 
274
                    // setting new listener
 
275
                    repr = this->knotholder->repr;
 
276
                    if (repr != listener_attached_for) {
 
277
                        Inkscape::GC::anchor(repr);
 
278
                        sp_repr_add_listener(repr, &shapeeditor_repr_events, this);
 
279
                        listener_attached_for = repr;
 
280
                    }
 
281
                }
 
282
                break;
209
283
        }
210
284
    }
211
285
}
212
286
 
213
287
/** Please note that this function only works for path parameters.
214
288
*  All other parameters probably will crash Inkscape!
215
 
*  Fortunately, there are no other on-canvas edittable objects at this moment :)
216
289
*/
217
 
void ShapeEditor::set_item_livepatheffect_parameter(SPItem *item, SPObject *lpeobject, const char * key) {
218
 
 
219
 
    unset_item();
 
290
void ShapeEditor::set_item_lpe_path_parameter(SPItem *item, LivePathEffectObject *lpeobject, const char * key)
 
291
{
 
292
    unset_item(SH_NODEPATH);
220
293
 
221
294
    this->grab_node = -1;
222
295
 
223
296
    if (lpeobject) {
224
 
        this->knotholder = NULL; // it's a path, no special knotholder needed.
 
297
        Inkscape::Preferences *prefs = Inkscape::Preferences::get();
225
298
        this->nodepath = sp_nodepath_new( desktop, lpeobject,
226
 
                                          (prefs_get_int_attribute("tools.nodes", "show_handles", 1) != 0),
 
299
                                          (prefs->getInt("/tools/nodes/show_handles", true)),
227
300
                                          key, item);
228
301
        if (this->nodepath) {
229
302
            this->nodepath->shape_editor = this;
230
303
 
231
304
            // setting new listener
232
305
            Inkscape::XML::Node *repr = SP_OBJECT_REPR(lpeobject);
233
 
            if (repr) {
 
306
            if (repr && repr != listener_attached_for) {
234
307
                Inkscape::GC::anchor(repr);
235
308
                sp_repr_add_listener(repr, &shapeeditor_repr_events, this);
 
309
                listener_attached_for = repr;
236
310
            }
237
311
        }
238
312
    }
239
313
}
240
314
 
241
 
/** FIXME: think about this. Is this thing only called when the item needs to be updated?
 
315
 
 
316
/** FIXME: This thing is only called when the item needs to be updated in response to repr change.
242
317
   Why not make a reload function in NodePath and in KnotHolder? */
243
 
void ShapeEditor::reset_item ()
 
318
void ShapeEditor::reset_item (SubType type, bool keep_knotholder)
244
319
{
245
 
    if ( (this->nodepath) && (IS_LIVEPATHEFFECT(this->nodepath->object)) ) {
246
 
        SPItem * item = this->nodepath->item;
247
 
        SPObject *obj = this->nodepath->object;
248
 
        char * key = g_strdup(this->nodepath->repr_key);
249
 
        set_item_livepatheffect_parameter(item, obj, key);
250
 
        g_free(key);
251
 
    } else {
252
 
        SPItem * item = get_item();
253
 
        set_item(item);
 
320
    /// note that it is not certain that this is an SPItem; it could be a LivePathEffectObject.
 
321
    SPObject *obj = sp_desktop_document(desktop)->getObjectByRepr(listener_attached_for);
 
322
 
 
323
    switch (type) {
 
324
        case SH_NODEPATH:
 
325
            if ( (nodepath) && (IS_LIVEPATHEFFECT(nodepath->object)) ) {
 
326
                char * key = g_strdup(nodepath->repr_key);
 
327
                set_item_lpe_path_parameter(nodepath->item, LIVEPATHEFFECT(nodepath->object), key); // the above checks for nodepath, so it is indeed a path that we are editing
 
328
                g_free(key);
 
329
            } else {
 
330
                set_item(SP_ITEM(obj), SH_NODEPATH);
 
331
            }
 
332
            break;
 
333
        case SH_KNOTHOLDER:
 
334
            if (this->knotholder) {
 
335
                set_item(SP_ITEM(obj), SH_KNOTHOLDER, keep_knotholder);
 
336
            }
 
337
            break;
254
338
    }
255
339
}
256
340
 
263
347
        sp_nodepath_update_statusbar(this->nodepath);
264
348
}
265
349
 
266
 
bool ShapeEditor::is_over_stroke (NR::Point event_p, bool remember) {
267
 
 
 
350
bool ShapeEditor::is_over_stroke (Geom::Point event_p, bool remember) {
268
351
    if (!this->nodepath)
269
352
        return false; // no stroke in knotholder
270
353
 
271
 
    SPItem *item = get_item();
 
354
    const SPItem *item = get_item(SH_NODEPATH);
272
355
 
273
356
    //Translate click point into proper coord system
274
357
    this->curvepoint_doc = desktop->w2d(event_p);
275
358
    this->curvepoint_doc *= sp_item_dt2i_affine(item);
276
359
 
277
 
    sp_nodepath_ensure_livarot_path(this->nodepath);
278
 
 
279
 
    NR::Maybe<Path::cut_position> position = get_nearest_position_on_Path(this->nodepath->livarot_path, this->curvepoint_doc);
280
 
    if (!position) {
 
360
    SPCurve *curve = this->nodepath->curve;   // not sure if np->curve is always up to date...
 
361
    Geom::PathVector const &pathv = curve->get_pathvector();
 
362
    boost::optional<Geom::PathVectorPosition> pvpos = Geom::nearestPoint(pathv, this->curvepoint_doc);
 
363
    if (!pvpos) {
 
364
        g_print("Warning! Possible error?\n");
281
365
        return false;
282
366
    }
283
367
 
284
 
    NR::Point nearest = get_point_on_Path(this->nodepath->livarot_path, position->piece, position->t);
285
 
    NR::Point delta = nearest - this->curvepoint_doc;
 
368
    Geom::Point nearest = pathv[pvpos->path_nr].pointAt(pvpos->t);
 
369
    Geom::Point delta = nearest - this->curvepoint_doc;
286
370
 
287
371
    delta = desktop->d2w(delta);
288
372
 
 
373
    Inkscape::Preferences *prefs = Inkscape::Preferences::get();
289
374
    double stroke_tolerance =
290
375
        (( !SP_OBJECT_STYLE(item)->stroke.isNone() ?
291
376
           desktop->current_zoom() *
292
377
           SP_OBJECT_STYLE (item)->stroke_width.computed * 0.5 *
293
 
           sp_item_i2d_affine (item).expansion()
 
378
           to_2geom(sp_item_i2d_affine(item)).descrim()
294
379
         : 0.0)
295
 
         + prefs_get_int_attribute_limited("options.dragtolerance", "value", 0, 0, 100)) /sp_item_i2d_affine (item).expansion(); 
296
 
    bool close = (NR::L2 (delta) < stroke_tolerance);
 
380
         + prefs->getIntLimited("/options/dragtolerance/value", 0, 0, 100)) / to_2geom(sp_item_i2d_affine(item)).descrim();
 
381
    bool close = (Geom::L2 (delta) < stroke_tolerance);
297
382
 
298
383
    if (remember && close) {
299
 
        this->curvepoint_event[NR::X] = (gint) event_p [NR::X];
300
 
        this->curvepoint_event[NR::Y] = (gint) event_p [NR::Y];
 
384
        // calculate index for nodepath's representation.
 
385
        double int_part;
 
386
        double t = std::modf(pvpos->t, &int_part);
 
387
        unsigned int segment_index = (unsigned int)int_part + 1;
 
388
        for (unsigned int i = 0; i < pvpos->path_nr; ++i) {
 
389
            segment_index += pathv[i].size() + 1;
 
390
            if (pathv[i].closed())
 
391
                segment_index += 1;
 
392
        }
 
393
 
 
394
        this->curvepoint_event[Geom::X] = (gint) event_p [Geom::X];
 
395
        this->curvepoint_event[Geom::Y] = (gint) event_p [Geom::Y];
301
396
        this->hit = true;
302
 
        this->grab_t = position->t;
303
 
        this->grab_node = position->piece;
 
397
        this->grab_t = t;
 
398
        this->grab_node = segment_index;
304
399
    }
305
400
 
306
401
    return close;
317
412
void ShapeEditor::select_segment_near_point(bool toggle) {
318
413
    if (this->nodepath) {
319
414
        sp_nodepath_select_segment_near_point(this->nodepath, this->curvepoint_doc, toggle);
320
 
    } else if (this->knotholder) {
 
415
    }
 
416
    if (this->knotholder) {
321
417
        // we do not select segments in knotholder... yet?
322
418
    }
323
419
}
348
444
 
349
445
 
350
446
        // The coordinates hasn't changed since the last motion event, abort
351
 
        if (this->curvepoint_event[NR::X] == x &&
352
 
            this->curvepoint_event[NR::Y] == y)
 
447
        if (this->curvepoint_event[Geom::X] == x &&
 
448
            this->curvepoint_event[Geom::Y] == y)
353
449
            return;
354
450
 
355
 
        NR::Point const delta_w(eventx - this->curvepoint_event[NR::X],
356
 
                                eventy - this->curvepoint_event[NR::Y]);
357
 
        NR::Point const delta_dt(this->desktop->w2d(delta_w));
358
 
 
359
 
        sp_nodepath_curve_drag (this->grab_node, this->grab_t, delta_dt); //!!! FIXME: which nodepath?!!! also uses current!!!
360
 
        this->curvepoint_event[NR::X] = x;
361
 
        this->curvepoint_event[NR::Y] = y;
362
 
 
363
 
    } else if (this->knotholder) {
 
451
        Geom::Point const delta_w(eventx - this->curvepoint_event[Geom::X],
 
452
                                  eventy - this->curvepoint_event[Geom::Y]);
 
453
        Geom::Point const delta_dt(this->desktop->w2d(delta_w));
 
454
 
 
455
        sp_nodepath_curve_drag (this->nodepath, this->grab_node, this->grab_t, delta_dt);
 
456
        this->curvepoint_event[Geom::X] = x;
 
457
        this->curvepoint_event[Geom::Y] = y;
 
458
 
 
459
    }
 
460
    if (this->knotholder) {
364
461
        // we do not drag curve in knotholder
365
462
    }
366
463
 
372
469
    }
373
470
}
374
471
 
375
 
void ShapeEditor::select_rect(NR::Rect const &rect, bool add) {
 
472
void ShapeEditor::select_rect(Geom::Rect const &rect, bool add) {
376
473
    if (this->nodepath) {
377
474
        sp_nodepath_select_rect(this->nodepath, rect, add);
378
475
    }
431
528
    sp_node_selected_set_line_type(this->nodepath, code);
432
529
}
433
530
 
434
 
void ShapeEditor::move_nodes_screen(gdouble dx, gdouble dy) {
435
 
    sp_node_selected_move_screen(this->nodepath, dx, dy);
 
531
void ShapeEditor::move_nodes_screen(SPDesktop *desktop, gdouble dx, gdouble dy) {
 
532
    sp_node_selected_move_screen(desktop, this->nodepath, dx, dy);
436
533
}
437
534
void ShapeEditor::move_nodes(gdouble dx, gdouble dy) {
438
535
    sp_node_selected_move(this->nodepath, dx, dy);
462
559
    if (this->nodepath) {
463
560
        sp_nodepath_select_next (this->nodepath);
464
561
        if (this->nodepath->numSelected() >= 1) {
465
 
            this->desktop->scroll_to_point(&(this->nodepath->singleSelectedCoords()), 1.0);
 
562
            this->desktop->scroll_to_point(this->nodepath->singleSelectedCoords(), 1.0);
466
563
        }
467
564
    }
468
565
}
470
567
    if (this->nodepath) {
471
568
        sp_nodepath_select_prev (this->nodepath);
472
569
        if (this->nodepath->numSelected() >= 1) {
473
 
            this->desktop->scroll_to_point(&(this->nodepath->singleSelectedCoords()), 1.0);
 
570
            this->desktop->scroll_to_point(this->nodepath->singleSelectedCoords(), 1.0);
474
571
        }
475
572
    }
476
573
}
480
577
        sp_nodepath_show_handles (this->nodepath, show);
481
578
}
482
579
 
 
580
void ShapeEditor::show_helperpath (bool show) {
 
581
    if (this->nodepath)
 
582
        sp_nodepath_show_helperpath (this->nodepath, show);
 
583
}
483
584
 
484
 
void ShapeEditor::flip (NR::Dim2 axis, NR::Maybe<NR::Point> center) {
 
585
void ShapeEditor::flip (Geom::Dim2 axis, boost::optional<Geom::Point> center) {
485
586
    if (this->nodepath)
486
587
        sp_nodepath_flip (this->nodepath, axis, center);
487
588
}
488
589
 
489
 
void ShapeEditor::distribute (NR::Dim2 axis) {
 
590
void ShapeEditor::distribute (Geom::Dim2 axis) {
490
591
    if (this->nodepath)
491
592
        sp_nodepath_selected_distribute (this->nodepath, axis);
492
593
}
493
 
void ShapeEditor::align (NR::Dim2 axis) {
 
594
void ShapeEditor::align (Geom::Dim2 axis) {
494
595
    if (this->nodepath)
495
596
        sp_nodepath_selected_align (this->nodepath, axis);
496
597
}