7
5
* Lauris Kaplinski <lauris@kaplinski.com>
8
6
* bulia byak <buliabyak@users.sf.net>
9
7
* Johan Engelen <j.b.c.engelen@ewi.utwente.nl>
8
* Jon A. Cruz <jon@joncruz.org>
11
11
* Copyright (C) 1999-2006 authors
12
12
* Copyright (C) 2000-2001 Ximian, Inc.
25
#include "display/nr-arena-group.h"
25
#include "display/drawing-group.h"
26
26
#include "display/curve.h"
27
#include "libnr/nr-matrix-ops.h"
28
#include "libnr/nr-matrix-fns.h"
29
27
#include "xml/repr.h"
30
28
#include "svg/svg.h"
31
29
#include "document.h"
64
65
static Inkscape::XML::Node *sp_group_write (SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
65
66
static void sp_group_set(SPObject *object, unsigned key, char const *value);
67
static void sp_group_bbox(SPItem const *item, NRRect *bbox, Geom::Matrix const &transform, unsigned const flags);
68
static Geom::OptRect sp_group_bbox(SPItem const *item, Geom::Affine const &transform, SPItem::BBoxType type);
68
69
static void sp_group_print (SPItem * item, SPPrintContext *ctx);
69
70
static gchar * sp_group_description (SPItem * item);
70
static NRArenaItem *sp_group_show (SPItem *item, NRArena *arena, unsigned int key, unsigned int flags);
71
static Inkscape::DrawingItem *sp_group_show (SPItem *item, Inkscape::Drawing &drawing, unsigned int key, unsigned int flags);
71
72
static void sp_group_hide (SPItem * item, unsigned int key);
72
73
static void sp_group_snappoints (SPItem const *item, std::vector<Inkscape::SnapCandidatePoint> &p, Inkscape::SnapPreferences const *snapprefs);
146
147
static void sp_group_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr)
148
sp_object_read_attr(object, "inkscape:groupmode");
149
object->readAttr( "inkscape:groupmode" );
150
151
if (((SPObjectClass *)parent_class)->build) {
151
152
((SPObjectClass *)parent_class)->build(object, document, repr);
155
156
static void sp_group_release(SPObject *object) {
156
157
if ( SP_GROUP(object)->_layer_mode == SPGroup::LAYER ) {
157
sp_document_remove_resource(SP_OBJECT_DOCUMENT(object), "layer", object);
158
object->document->removeResource("layer", object);
159
160
if (((SPObjectClass *)parent_class)->release) {
160
161
((SPObjectClass *)parent_class)->release(object);
168
169
delete SP_GROUP(object)->group;
172
sp_group_child_added (SPObject *object, Inkscape::XML::Node *child, Inkscape::XML::Node *ref)
172
static void sp_group_child_added(SPObject *object, Inkscape::XML::Node *child, Inkscape::XML::Node *ref)
176
item = SP_ITEM (object);
178
if (((SPObjectClass *) (parent_class))->child_added)
174
SPGroup *group = SP_GROUP(object);
176
if (((SPObjectClass *) (parent_class))->child_added) {
179
177
(* ((SPObjectClass *) (parent_class))->child_added) (object, child, ref);
181
SP_GROUP(object)->group->onChildAdded(child);
180
group->group->onChildAdded(child);
184
183
/* fixme: hide (Lauris) */
219
218
SP_GROUP(object)->group->onModified(flags);
222
static Inkscape::XML::Node *
223
sp_group_write (SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags)
221
static Inkscape::XML::Node * sp_group_write(SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags)
227
Inkscape::XML::Node *crepr;
229
group = SP_GROUP (object);
223
SPGroup *group = SP_GROUP(object);
231
225
if (flags & SP_OBJECT_WRITE_BUILD) {
234
if (SP_IS_SWITCH(object))
228
if (SP_IS_SWITCH(object)) {
235
229
repr = xml_doc->createElement("svg:switch");
237
231
repr = xml_doc->createElement("svg:g");
240
for (child = sp_object_first_child(object); child != NULL; child = SP_OBJECT_NEXT(child) ) {
241
if (SP_IS_TITLE(child) || SP_IS_DESC(child)) continue;
242
crepr = child->updateRepr(xml_doc, NULL, flags);
243
if (crepr) l = g_slist_prepend (l, crepr);
235
for (SPObject *child = object->firstChild(); child; child = child->getNext() ) {
236
if ( !SP_IS_TITLE(child) && !SP_IS_DESC(child) ) {
237
Inkscape::XML::Node *crepr = child->updateRepr(xml_doc, NULL, flags);
239
l = g_slist_prepend (l, crepr);
246
244
repr->addChild((Inkscape::XML::Node *) l->data, NULL);
248
246
l = g_slist_remove (l, l->data);
251
for (child = sp_object_first_child(object) ; child != NULL; child = SP_OBJECT_NEXT(child) ) {
252
if (SP_IS_TITLE(child) || SP_IS_DESC(child)) continue;
253
child->updateRepr(flags);
249
for (SPObject *child = object->firstChild() ; child ; child = child->getNext() ) {
250
if ( !SP_IS_TITLE(child) && !SP_IS_DESC(child) ) {
251
child->updateRepr(flags);
268
267
repr->setAttribute("inkscape:groupmode", value);
271
if (((SPObjectClass *) (parent_class))->write)
270
if (((SPObjectClass *) (parent_class))->write) {
272
271
((SPObjectClass *) (parent_class))->write (object, xml_doc, repr, flags);
278
sp_group_bbox(SPItem const *item, NRRect *bbox, Geom::Matrix const &transform, unsigned const flags)
278
sp_group_bbox(SPItem const *item, Geom::Affine const &transform, SPItem::BBoxType type)
280
SP_GROUP(item)->group->calculateBBox(bbox, transform, flags);
280
return SP_GROUP(item)->group->bounds(type, transform);
316
sp_group_show (SPItem *item, NRArena *arena, unsigned int key, unsigned int flags)
315
static Inkscape::DrawingItem *
316
sp_group_show (SPItem *item, Inkscape::Drawing &drawing, unsigned int key, unsigned int flags)
318
return SP_GROUP(item)->group->show(arena, key, flags);
318
return SP_GROUP(item)->group->show(drawing, key, flags);
324
324
SP_GROUP(item)->group->hide(key);
327
static void sp_group_snappoints (SPItem const *item, std::vector<Inkscape::SnapCandidatePoint> &p, Inkscape::SnapPreferences const *snapprefs)
327
static void sp_group_snappoints(SPItem const *item, std::vector<Inkscape::SnapCandidatePoint> &p, Inkscape::SnapPreferences const *snapprefs)
329
for (SPObject const *o = sp_object_first_child(SP_OBJECT(item));
331
o = SP_OBJECT_NEXT(o))
329
for ( SPObject const *o = item->firstChild(); o; o = o->getNext() )
333
331
if (SP_IS_ITEM(o)) {
334
sp_item_snappoints(SP_ITEM(o), p, snapprefs);
332
SP_ITEM(o)->getSnappoints(p, snapprefs);
343
341
g_return_if_fail (group != NULL);
344
342
g_return_if_fail (SP_IS_GROUP (group));
346
SPDocument *doc = SP_OBJECT_DOCUMENT (group);
347
SPObject *root = SP_DOCUMENT_ROOT (doc);
348
SPObject *defs = SP_OBJECT (SP_ROOT (root)->defs);
344
SPDocument *doc = group->document;
345
SPRoot *root = doc->getRoot();
346
SPObject *defs = root->defs;
350
SPItem *gitem = SP_ITEM (group);
351
Inkscape::XML::Node *grepr = SP_OBJECT_REPR (gitem);
348
SPItem *gitem = group;
349
Inkscape::XML::Node *grepr = gitem->getRepr();
353
351
g_return_if_fail (!strcmp (grepr->name(), "svg:g") || !strcmp (grepr->name(), "svg:a") || !strcmp (grepr->name(), "svg:switch"));
355
353
// this converts the gradient/pattern fill/stroke on the group, if any, to userSpaceOnUse
356
sp_item_adjust_paint_recursive (gitem, Geom::identity(), Geom::identity(), false);
354
gitem->adjust_paint_recursive (Geom::identity(), Geom::identity(), false);
358
SPItem *pitem = SP_ITEM (SP_OBJECT_PARENT (gitem));
359
Inkscape::XML::Node *prepr = SP_OBJECT_REPR (pitem);
356
SPItem *pitem = SP_ITEM(gitem->parent);
357
Inkscape::XML::Node *prepr = pitem->getRepr();
361
359
if (SP_IS_BOX3D(gitem)) {
362
360
group = box3d_convert_to_group(SP_BOX3D(gitem));
363
gitem = SP_ITEM(group);
366
364
sp_lpe_item_remove_all_path_effects(SP_LPE_ITEM(group), false);
377
375
/* Merging of style */
378
376
// this converts the gradient/pattern fill/stroke, if any, to userSpaceOnUse; we need to do
379
377
// it here _before_ the new transform is set, so as to use the pre-transform bbox
380
sp_item_adjust_paint_recursive (citem, Geom::identity(), Geom::identity(), false);
378
citem->adjust_paint_recursive (Geom::identity(), Geom::identity(), false);
382
sp_style_merge_from_dying_parent(SP_OBJECT_STYLE(child), SP_OBJECT_STYLE(gitem));
380
sp_style_merge_from_dying_parent(child->style, gitem->style);
384
382
* fixme: We currently make no allowance for the case where child is cloned
385
383
* and the group has any style settings.
405
403
child->updateRepr();
407
Inkscape::XML::Node *nrepr = SP_OBJECT_REPR (child)->duplicate(prepr->document());
405
Inkscape::XML::Node *nrepr = child->getRepr()->duplicate(prepr->document());
409
407
// Merging transform
411
Geom::Matrix const g(gitem->transform);
409
Geom::Affine const g(gitem->transform);
412
410
if (SP_IS_USE(citem) && sp_use_get_original (SP_USE(citem)) &&
413
SP_OBJECT_PARENT (sp_use_get_original (SP_USE(citem))) == SP_OBJECT(group)) {
411
sp_use_get_original( SP_USE(citem) )->parent == SP_OBJECT(group)) {
414
412
// make sure a clone's effective transform is the same as was under group
415
413
ctrans = g.inverse() * citem->transform * g;
417
// We should not apply the group's transformation to both a linked offset AND to its source
418
if (SP_IS_OFFSET(citem)) { // Do we have an offset at hand (whether it's dynamic or linked)?
419
SPItem *source = sp_offset_get_source(SP_OFFSET(citem));
420
// When dealing with a chain of linked offsets, the transformation of an offset will be
421
// tied to the transformation of the top-most source, not to any of the intermediate
422
// offsets. So let's find the top-most source
423
while (source != NULL && SP_IS_OFFSET(source)) {
424
source = sp_offset_get_source(SP_OFFSET(source));
426
if (source != NULL && // If true then we must be dealing with a linked offset ...
427
SP_OBJECT(group)->isAncestorOf(SP_OBJECT(source)) == false) { // ... of which the source is not in the same group
428
ctrans = citem->transform * g; // then we should apply the transformation of the group to the offset
430
ctrans = citem->transform;
415
// We should not apply the group's transformation to both a linked offset AND to its source
416
if (SP_IS_OFFSET(citem)) { // Do we have an offset at hand (whether it's dynamic or linked)?
417
SPItem *source = sp_offset_get_source(SP_OFFSET(citem));
418
// When dealing with a chain of linked offsets, the transformation of an offset will be
419
// tied to the transformation of the top-most source, not to any of the intermediate
420
// offsets. So let's find the top-most source
421
while (source != NULL && SP_IS_OFFSET(source)) {
422
source = sp_offset_get_source(SP_OFFSET(source));
424
if (source != NULL && // If true then we must be dealing with a linked offset ...
425
group->isAncestorOf(source) == false) { // ... of which the source is not in the same group
426
ctrans = citem->transform * g; // then we should apply the transformation of the group to the offset
428
ctrans = citem->transform;
433
ctrans = citem->transform * g;
431
ctrans = citem->transform * g;
451
449
items = g_slist_prepend (items, nrepr);
454
Inkscape::XML::Node *nrepr = SP_OBJECT_REPR (child)->duplicate(prepr->document());
452
Inkscape::XML::Node *nrepr = child->getRepr()->duplicate(prepr->document());
455
453
objects = g_slist_prepend (objects, nrepr);
459
457
/* Step 2 - clear group */
460
458
// remember the position of the group
461
gint pos = SP_OBJECT_REPR(group)->position();
459
gint pos = group->getRepr()->position();
463
461
// the group is leaving forever, no heir, clones should take note; its children however are going to reemerge
464
SP_OBJECT (group)->deleteObject(true, false);
462
group->deleteObject(true, false);
466
464
/* Step 3 - add nonitems */
468
Inkscape::XML::Node *last_def = SP_OBJECT_REPR(defs)->lastChild();
466
Inkscape::XML::Node *last_def = defs->getRepr()->lastChild();
469
467
while (objects) {
470
Inkscape::XML::Node *repr = (Inkscape::XML::Node *) objects->data;
471
if (!sp_repr_is_meta_element(repr))
472
SP_OBJECT_REPR(defs)->addChild(repr, last_def);
473
Inkscape::GC::release(repr);
474
objects = g_slist_remove (objects, objects->data);
468
Inkscape::XML::Node *repr = (Inkscape::XML::Node *) objects->data;
469
if (!sp_repr_is_meta_element(repr)) {
470
defs->getRepr()->addChild(repr, last_def);
472
Inkscape::GC::release(repr);
473
objects = g_slist_remove (objects, objects->data);
487
486
// fill in the children list if non-null
488
487
SPItem *item = (SPItem *) doc->getObjectByRepr(repr);
490
sp_item_write_transform(item, repr, item->transform, NULL, false);
489
item->doWriteTransform(repr, item->transform, NULL, false);
492
491
Inkscape::GC::release(repr);
493
492
if (children && SP_IS_ITEM (item))
496
495
items = g_slist_remove (items, items->data);
500
sp_document_done (doc, SP_VERB_NONE, _("Ungroup"));
499
DocumentUndo::done(doc, SP_VERB_NONE, _("Ungroup"));
504
504
* some API for list aspect of SPGroup
508
sp_item_group_item_list (SPGroup * group)
507
GSList *sp_item_group_item_list(SPGroup * group)
510
g_return_val_if_fail (group != NULL, NULL);
511
g_return_val_if_fail (SP_IS_GROUP (group), NULL);
509
g_return_val_if_fail(group != NULL, NULL);
510
g_return_val_if_fail(SP_IS_GROUP(group), NULL);
513
512
GSList *s = NULL;
515
for (SPObject *o = sp_object_first_child(SP_OBJECT(group)) ; o != NULL ; o = SP_OBJECT_NEXT(o) ) {
516
if (SP_IS_ITEM (o)) {
517
s = g_slist_prepend (s, o);
514
for (SPObject *o = group->firstChild() ; o ; o = o->getNext() ) {
515
if ( SP_IS_ITEM(o) ) {
516
s = g_slist_prepend(s, o);
521
520
return g_slist_reverse (s);
525
sp_item_group_get_child_by_name (SPGroup *group, SPObject *ref, const gchar *name)
523
SPObject *sp_item_group_get_child_by_name(SPGroup *group, SPObject *ref, const gchar *name)
528
child = (ref) ? SP_OBJECT_NEXT(ref) : sp_object_first_child(SP_OBJECT(group));
529
while ( child && strcmp (SP_OBJECT_REPR(child)->name(), name) ) {
530
child = SP_OBJECT_NEXT(child);
525
SPObject *child = (ref) ? ref->getNext() : group->firstChild();
526
while ( child && strcmp(child->getRepr()->name(), name) ) {
527
child = child->getNext();
535
532
void SPGroup::setLayerMode(LayerMode mode) {
536
533
if ( _layer_mode != mode ) {
537
534
if ( mode == LAYER ) {
538
sp_document_add_resource(SP_OBJECT_DOCUMENT(this), "layer", this);
535
this->document->addResource("layer", this);
539
536
} else if ( _layer_mode == LAYER ) {
540
sp_document_remove_resource(SP_OBJECT_DOCUMENT(this), "layer", this);
537
this->document->removeResource("layer", this);
542
539
_layer_mode = mode;
543
540
_updateLayerMode();
565
562
SPItemView *view;
566
563
for ( view = this->display ; view ; view = view->next ) {
567
564
if ( !display_key || view->key == display_key ) {
568
NRArenaGroup *arena_group=NR_ARENA_GROUP(view->arenaitem);
570
nr_arena_group_set_transparent(arena_group, effectiveLayerMode(view->key) == SPGroup::LAYER);
565
Inkscape::DrawingGroup *g = dynamic_cast<Inkscape::DrawingGroup *>(view->arenaitem);
567
g->setPickChildren(effectiveLayerMode(view->key) == SPGroup::LAYER);
576
573
void SPGroup::translateChildItems(Geom::Translate const &tr)
578
if (this->hasChildren())
581
for (o = sp_object_first_child(SP_OBJECT(this)) ; o != NULL ; o = SP_OBJECT_NEXT(o) ) {
582
if (SP_IS_ITEM (o)) {
583
sp_item_move_rel(static_cast<SPItem *>(o), tr);
575
if ( hasChildren() ) {
576
for (SPObject *o = firstChild() ; o ; o = o->getNext() ) {
577
if ( SP_IS_ITEM(o) ) {
578
sp_item_move_rel(reinterpret_cast<SPItem *>(o), tr);
596
591
void CGroup::onChildAdded(Inkscape::XML::Node *child) {
597
592
SPObject *last_child = _group->lastChild();
598
if (last_child && SP_OBJECT_REPR(last_child) == child) {
593
if (last_child && last_child->getRepr() == child) {
599
594
// optimization for the common special case where the child is being added at the end
600
595
SPObject *ochild = last_child;
601
596
if ( SP_IS_ITEM(ochild) ) {
602
597
/* TODO: this should be moved into SPItem somehow */
599
Inkscape::DrawingItem *ac;
606
601
for (v = _group->display; v != NULL; v = v->next) {
607
ac = sp_item_invoke_show (SP_ITEM (ochild), NR_ARENA_ITEM_ARENA (v->arenaitem), v->key, v->flags);
602
ac = SP_ITEM (ochild)->invoke_show (v->arenaitem->drawing(), v->key, v->flags);
610
nr_arena_item_append_child (v->arenaitem, ac);
605
v->arenaitem->appendChild(ac);
614
609
} else { // general case
615
SPObject *ochild = sp_object_get_child_by_repr(_group, child);
610
SPObject *ochild = _group->get_child_by_repr(child);
616
611
if ( ochild && SP_IS_ITEM(ochild) ) {
617
612
/* TODO: this should be moved into SPItem somehow */
614
Inkscape::DrawingItem *ac;
621
unsigned position = sp_item_pos_in_parent(SP_ITEM(ochild));
616
unsigned position = SP_ITEM(ochild)->pos_in_parent();
623
618
for (v = _group->display; v != NULL; v = v->next) {
624
ac = sp_item_invoke_show (SP_ITEM (ochild), NR_ARENA_ITEM_ARENA (v->arenaitem), v->key, v->flags);
619
ac = SP_ITEM (ochild)->invoke_show (v->arenaitem->drawing(), v->key, v->flags);
627
nr_arena_item_add_child (v->arenaitem, ac, NULL);
628
nr_arena_item_set_order (ac, position);
622
v->arenaitem->prependChild(ac);
623
ac->setZOrder(position);
651
646
flags &= SP_OBJECT_MODIFIED_CASCADE;
653
648
if (flags & SP_OBJECT_STYLE_MODIFIED_FLAG) {
654
SPObject *object = SP_OBJECT(_group);
655
for (SPItemView *v = SP_ITEM(_group)->display; v != NULL; v = v->next) {
656
nr_arena_group_set_style(NR_ARENA_GROUP(v->arenaitem), SP_OBJECT_STYLE(object));
649
SPObject *object = _group;
650
for (SPItemView *v = _group->display; v != NULL; v = v->next) {
651
Inkscape::DrawingGroup *group = dynamic_cast<Inkscape::DrawingGroup *>(v->arenaitem);
652
group->setStyle(object->style);
660
656
GSList *l = g_slist_reverse(_group->childList(true, SPObject::ActionUpdate));
682
678
flags &= SP_OBJECT_MODIFIED_CASCADE;
684
680
if (flags & SP_OBJECT_STYLE_MODIFIED_FLAG) {
685
SPObject *object = SP_OBJECT(_group);
686
for (SPItemView *v = SP_ITEM(_group)->display; v != NULL; v = v->next) {
687
nr_arena_group_set_style(NR_ARENA_GROUP(v->arenaitem), SP_OBJECT_STYLE(object));
681
SPObject *object = _group;
682
for (SPItemView *v = _group->display; v != NULL; v = v->next) {
683
Inkscape::DrawingGroup *group = dynamic_cast<Inkscape::DrawingGroup *>(v->arenaitem);
684
group->setStyle(object->style);
691
688
GSList *l = g_slist_reverse(_group->childList(true));
702
void CGroup::calculateBBox(NRRect *bbox, Geom::Matrix const &transform, unsigned const flags) {
704
Geom::OptRect dummy_bbox;
699
Geom::OptRect CGroup::bounds(SPItem::BBoxType type, Geom::Affine const &transform)
706
703
GSList *l = _group->childList(false, SPObject::ActionBBox);
708
705
SPObject *o = SP_OBJECT (l->data);
709
706
if (SP_IS_ITEM(o) && !SP_ITEM(o)->isHidden()) {
710
707
SPItem *child = SP_ITEM(o);
711
Geom::Matrix const ct(to_2geom(child->transform) * transform);
712
sp_item_invoke_bbox_full(child, dummy_bbox, ct, flags, FALSE);
708
Geom::Affine const ct(child->transform * transform);
709
bbox |= child->bounds(type, ct);
714
711
l = g_slist_remove (l, o);
717
*bbox = NRRect(dummy_bbox);
720
716
void CGroup::onPrint(SPPrintContext *ctx) {
750
NRArenaItem *CGroup::show (NRArena *arena, unsigned int key, unsigned int flags) {
752
SPObject *object = SP_OBJECT(_group);
754
ai = NRArenaGroup::create(arena);
756
nr_arena_group_set_transparent(NR_ARENA_GROUP (ai),
757
_group->effectiveLayerMode(key) ==
759
nr_arena_group_set_style(NR_ARENA_GROUP(ai), SP_OBJECT_STYLE(object));
761
_showChildren(arena, ai, key, flags);
746
Inkscape::DrawingItem *CGroup::show (Inkscape::Drawing &drawing, unsigned int key, unsigned int flags) {
747
Inkscape::DrawingGroup *ai;
748
SPObject *object = _group;
750
ai = new Inkscape::DrawingGroup(drawing);
751
ai->setPickChildren(_group->effectiveLayerMode(key) == SPGroup::LAYER);
752
ai->setStyle(object->style);
754
_showChildren(drawing, ai, key, flags);
765
void CGroup::_showChildren (NRArena *arena, NRArenaItem *ai, unsigned int key, unsigned int flags) {
766
NRArenaItem *ac = NULL;
767
NRArenaItem *ar = NULL;
758
void CGroup::_showChildren (Inkscape::Drawing &drawing, Inkscape::DrawingItem *ai, unsigned int key, unsigned int flags) {
759
Inkscape::DrawingItem *ac = NULL;
768
760
SPItem * child = NULL;
769
761
GSList *l = g_slist_reverse(_group->childList(false, SPObject::ActionShow));
771
763
SPObject *o = SP_OBJECT (l->data);
772
764
if (SP_IS_ITEM (o)) {
773
765
child = SP_ITEM (o);
774
ac = sp_item_invoke_show (child, arena, key, flags);
776
nr_arena_item_add_child (ai, ac, ar);
766
ac = child->invoke_show (drawing, key, flags);
780
769
l = g_slist_remove (l, o);
801
790
void CGroup::onOrderChanged (Inkscape::XML::Node *child, Inkscape::XML::Node *, Inkscape::XML::Node *)
803
SPObject *ochild = sp_object_get_child_by_repr(_group, child);
792
SPObject *ochild = _group->get_child_by_repr(child);
804
793
if ( ochild && SP_IS_ITEM(ochild) ) {
805
794
/* TODO: this should be moved into SPItem somehow */
807
unsigned position = sp_item_pos_in_parent(SP_ITEM(ochild));
796
unsigned position = SP_ITEM(ochild)->pos_in_parent();
808
797
for ( v = SP_ITEM (ochild)->display ; v != NULL ; v = v->next ) {
809
nr_arena_item_set_order (v->arenaitem, position);
798
v->arenaitem->setZOrder(position);
858
847
if (SP_IS_PATH(subitem)) {
859
848
c = sp_path_get_original_curve(SP_PATH(subitem));
861
c = sp_shape_get_curve(SP_SHAPE(subitem));
850
c = SP_SHAPE(subitem)->getCurve();
863
852
// only run LPEs when the shape has a curve defined
865
854
sp_lpe_item_perform_path_effect(SP_LPE_ITEM(topgroup), c);
866
sp_shape_set_curve(SP_SHAPE(subitem), c, TRUE);
855
SP_SHAPE(subitem)->setCurve(c, TRUE);
869
Inkscape::XML::Node *repr = SP_OBJECT_REPR(subitem);
858
Inkscape::XML::Node *repr = subitem->getRepr();
870
859
gchar *str = sp_svg_write_path(c->get_pathvector());
871
860
repr->setAttribute("d", str);
872
861
#ifdef GROUP_VERBOSE