~ubuntu-branches/ubuntu/utopic/inkscape/utopic-proposed

« back to all changes in this revision

Viewing changes to src/ui/tool/multi-path-manipulator.cpp

  • Committer: Package Import Robot
  • Author(s): Alex Valavanis
  • Date: 2014-08-19 19:10:32 UTC
  • mfrom: (1.6.5) (2.5.14 sid)
  • Revision ID: package-import@ubuntu.com-20140819191032-2eca1qihaszjk9i6
Tags: 0.48.5-2ubuntu1
* Merge with Debian Unstable (LP: #1358863). Fixes several Ubuntu bugs:
  - Illustrator CS SVG won't load: namespace URIs in entities (LP: #166371)
  - inkscape crashed with SIGSEGV in
    sp_dtw_color_profile_event() (LP: #966441)
  - inkscape crashed with SIGSEGV (LP: #1051017)
  - inkscape crashed with SIGSEGV in Inkscape::Preferences::_getNode()
    (LP: #1163241)
  - save a copy reverts to save as (LP: #529843)
  - Extension to braille not working on Xubuntu 12.10 (LP: #1090865)
* Remaining changes:
  - debian/control:
    + Set Ubuntu Developer as maintainer,
    + build-depend on dh-translation to handle Ubuntu translation,
    + demote pstoedit from Recommends to Suggests (because it's in universe),
  - debian/patches/0006_add_unity_quicklist_support.patch: add.
  - debian/patches/series: update.
  - debian/rules:
    + add dh_translation to handle Ubuntu translation
* Drop debian/patches/librevenge.patch (superseded by
    debian/patches/0006-Update_to_new_libwpg.patch)

Show diffs side-by-side

added added

removed removed

Lines of Context:
218
218
    SubpathList::iterator last_j;
219
219
    NodeList::iterator last_k;
220
220
    bool anything_found = false;
 
221
    bool anynode_found = false;
221
222
 
222
223
    for (MapType::iterator i = _mmap.begin(); i != _mmap.end(); ++i) {
223
224
        SubpathList &sp = i->second->subpathList();
224
225
        for (SubpathList::iterator j = sp.begin(); j != sp.end(); ++j) {
 
226
            anynode_found = true;
225
227
            for (NodeList::iterator k = (*j)->begin(); k != (*j)->end(); ++k) {
226
228
                if (k->selected()) {
227
229
                    last_i = i;
243
245
    if (!anything_found) {
244
246
        // select first / last node
245
247
        // this should never fail because there must be at least 1 non-empty manipulator
246
 
        if (dir == 1) {
 
248
        if (anynode_found) {
 
249
          if (dir == 1) {
247
250
            _selection.insert((*_mmap.begin()->second->subpathList().begin())->begin().ptr());
248
 
        } else {
 
251
          } else {
249
252
            _selection.insert((--(*--(--_mmap.end())->second->subpathList().end())->end()).ptr());
 
253
          }
250
254
        }
251
255
        return;
252
256
    }
329
333
 
330
334
void MultiPathManipulator::insertNodes()
331
335
{
 
336
    if (_selection.empty()) return;
332
337
    invokeForAll(&PathManipulator::insertNodes);
333
338
    _done(_("Add nodes"));
334
339
}
335
340
 
336
341
void MultiPathManipulator::duplicateNodes()
337
342
{
 
343
    if (_selection.empty()) return;
338
344
    invokeForAll(&PathManipulator::duplicateNodes);
339
345
    _done(_("Duplicate nodes"));
340
346
}
341
347
 
342
348
void MultiPathManipulator::joinNodes()
343
349
{
 
350
    if (_selection.empty()) return;
344
351
    invokeForAll(&PathManipulator::hideDragPoint);
345
352
    // Node join has two parts. In the first one we join two subpaths by fusing endpoints
346
353
    // into one. In the second we fuse nodes in each subpath.
418
425
/** Join selected endpoints to create segments. */
419
426
void MultiPathManipulator::joinSegments()
420
427
{
 
428
    if (_selection.empty()) return;
421
429
    IterPairList joins;
422
430
    find_join_iterators(_selection, joins);
423
431
 
450
458
 
451
459
void MultiPathManipulator::alignNodes(Geom::Dim2 d)
452
460
{
 
461
    if (_selection.empty()) return;
453
462
    _selection.align(d);
454
463
    if (d == Geom::X) {
455
464
        _done("Align nodes to a horizontal line");
460
469
 
461
470
void MultiPathManipulator::distributeNodes(Geom::Dim2 d)
462
471
{
 
472
    if (_selection.empty()) return;
463
473
    _selection.distribute(d);
464
474
    if (d == Geom::X) {
465
475
        _done("Distrubute nodes horizontally");
702
712
        case GDK_u:
703
713
        case GDK_U:
704
714
            if (held_only_shift(event->key)) {
705
 
                // Shift+L - make segments curves
 
715
                // Shift+U - make segments curves
706
716
                setSegmentType(SEGMENT_CUBIC_BEZIER);
707
717
                return true;
708
718
            }