summaryrefslogtreecommitdiffstats
path: root/src/ui
diff options
context:
space:
mode:
authorJabiertxof <jtx@jtx>2017-01-24 00:39:06 +0000
committerJabiertxof <jtx@jtx>2017-01-24 00:39:06 +0000
commitda07c5edaeefe35a92662e42579b3e0b36621cbb (patch)
treebd783169733a4b06927601fca59ec569dc5317b5 /src/ui
parentUpdate to trunk (diff)
parentfix nodes reverting back during editing (diff)
downloadinkscape-da07c5edaeefe35a92662e42579b3e0b36621cbb.tar.gz
inkscape-da07c5edaeefe35a92662e42579b3e0b36621cbb.zip
Remove some code and make dependant of rotate copies
(bzr r15295.1.63)
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/clipboard.cpp40
-rw-r--r--src/ui/tool/transform-handle-set.cpp5
-rw-r--r--src/ui/widget/selected-style.cpp57
3 files changed, 26 insertions, 76 deletions
diff --git a/src/ui/clipboard.cpp b/src/ui/clipboard.cpp
index a8e708597..c1e824c1e 100644
--- a/src/ui/clipboard.cpp
+++ b/src/ui/clipboard.cpp
@@ -643,7 +643,6 @@ Glib::ustring ClipboardManagerImpl::getShapeOrTextObjectId(SPDesktop *desktop)
return svgd;
}
-
/**
* Iterate over a list of items and copy them to the clipboard.
*/
@@ -689,25 +688,6 @@ void ClipboardManagerImpl::_copySelection(ObjectSet *selection)
else
obj_copy = _copyNode(obj, _doc, _clipnode);
- // For lpe items, copy lpe stack if applicable
- SPLPEItem *lpeitem = dynamic_cast<SPLPEItem *>(item);
- if (lpeitem) {
- Inkscape::SVGOStringStream os;
- if (lpeitem->hasPathEffect()) {
- for (PathEffectList::iterator it = lpeitem->path_effect_list->begin(); it != lpeitem->path_effect_list->end(); ++it)
- {
- LivePathEffectObject *lpeobj = (*it)->lpeobject;
- if (lpeobj) {
- Inkscape::XML::Node * lpeobjcopy = _copyNode(lpeobj->getRepr(), _doc, _defs);
- gchar *new_conflict_id = sp_object_get_unique_id(lpeobj, lpeobj->getAttribute("id"));
- lpeobjcopy->setAttribute("id", new_conflict_id);
- g_free(new_conflict_id);
- os << "#" << lpeobjcopy->attribute("id") << ";";
- }
- }
- }
- obj_copy->setAttribute("inkscape:path-effect", os.str().c_str());
- }
// copy complete inherited style
SPCSSAttr *css = sp_repr_css_attr_inherited(obj, "style");
sp_repr_css_set(obj_copy, css, "style");
@@ -739,6 +719,13 @@ void ClipboardManagerImpl::_copySelection(ObjectSet *selection)
sp_repr_css_set(_clipnode, style, "style");
sp_repr_css_attr_unref(style);
}
+ // copy path effect from the first path
+ if (object) {
+ gchar const *effect =object->getRepr()->attribute("inkscape:path-effect");
+ if (effect) {
+ _clipnode->setAttribute("inkscape:path-effect", effect);
+ }
+ }
}
Geom::OptRect size = selection->visualBounds();
@@ -841,6 +828,19 @@ void ClipboardManagerImpl::_copyUsedDefs(SPItem *item)
}
}
+ // For lpe items, copy lpe stack if applicable
+ SPLPEItem *lpeitem = dynamic_cast<SPLPEItem *>(item);
+ if (lpeitem) {
+ if (lpeitem->hasPathEffect()) {
+ for (PathEffectList::iterator it = lpeitem->path_effect_list->begin(); it != lpeitem->path_effect_list->end(); ++it){
+ LivePathEffectObject *lpeobj = (*it)->lpeobject;
+ if (lpeobj) {
+ _copyNode(lpeobj->getRepr(), _doc, _defs);
+ }
+ }
+ }
+ }
+
// recurse
for(auto& o: item->children) {
SPItem *childItem = dynamic_cast<SPItem *>(&o);
diff --git a/src/ui/tool/transform-handle-set.cpp b/src/ui/tool/transform-handle-set.cpp
index 33015fe11..083a7d0ba 100644
--- a/src/ui/tool/transform-handle-set.cpp
+++ b/src/ui/tool/transform-handle-set.cpp
@@ -183,6 +183,11 @@ void TransformHandle::ungrabbed(GdkEventButton *)
_setState(_state);
endTransform();
_th.signal_commit.emit(getCommitEvent());
+
+ //updates the positions of the nodes
+ Inkscape::UI::Tools::NodeTool *nt = INK_NODE_TOOL(_th._desktop->event_context);
+ ControlPointSelection* selection = nt->_selected_nodes;
+ selection->setOriginalPoints();
}
diff --git a/src/ui/widget/selected-style.cpp b/src/ui/widget/selected-style.cpp
index fa7a83732..0370d55db 100644
--- a/src/ui/widget/selected-style.cpp
+++ b/src/ui/widget/selected-style.cpp
@@ -781,62 +781,7 @@ void SelectedStyle::on_stroke_paste() {
}
void SelectedStyle::on_fillstroke_swap() {
- SPCSSAttr *css = sp_repr_css_attr_new ();
-
- switch (_mode[SS_FILL]) {
- case SS_NA:
- case SS_MANY:
- break;
- case SS_NONE:
- sp_repr_css_set_property (css, "stroke", "none");
- break;
- case SS_UNSET:
- sp_repr_css_unset_property (css, "stroke");
- break;
- case SS_COLOR:
- gchar c[64];
- sp_svg_write_color (c, sizeof(c), _thisselected[SS_FILL]);
- sp_repr_css_set_property (css, "stroke", c);
- break;
- case SS_LGRADIENT:
- case SS_RGRADIENT:
-#ifdef WITH_MESH
- case SS_MGRADIENT:
-#endif
- case SS_PATTERN:
- sp_repr_css_set_property (css, "stroke", _paintserver_id[SS_FILL].c_str());
- break;
- }
-
- switch (_mode[SS_STROKE]) {
- case SS_NA:
- case SS_MANY:
- break;
- case SS_NONE:
- sp_repr_css_set_property (css, "fill", "none");
- break;
- case SS_UNSET:
- sp_repr_css_unset_property (css, "fill");
- break;
- case SS_COLOR:
- gchar c[64];
- sp_svg_write_color (c, sizeof(c), _thisselected[SS_STROKE]);
- sp_repr_css_set_property (css, "fill", c);
- break;
- case SS_LGRADIENT:
- case SS_RGRADIENT:
-#ifdef WITH_MESH
- case SS_MGRADIENT:
-#endif
- case SS_PATTERN:
- sp_repr_css_set_property (css, "fill", _paintserver_id[SS_STROKE].c_str());
- break;
- }
-
- sp_desktop_set_style (_desktop, css);
- sp_repr_css_attr_unref (css);
- DocumentUndo::done(_desktop->getDocument(), SP_VERB_DIALOG_FILL_STROKE,
- _("Swap fill and stroke"));
+ _desktop->getSelection()->swapFillStroke();
}
void SelectedStyle::on_fill_edit() {