From 72c8020b8036c0f4dce9ce6c0e269a29624ed6f2 Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Mon, 16 Jun 2014 01:02:03 +0200 Subject: add proper refcounting to XML SignalObserver. not refcounting caused crash upon opening Filter Editor dialog for the first time with a filtered object selected. Fixed bugs: - https://launchpad.net/bugs/1328152 (bzr r13426) --- src/xml/helper-observer.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/xml/helper-observer.cpp b/src/xml/helper-observer.cpp index c54dd8e74..e56ddc6f8 100644 --- a/src/xml/helper-observer.cpp +++ b/src/xml/helper-observer.cpp @@ -5,7 +5,7 @@ namespace XML { // Very simple observer that just emits a signal if anything happens to a node SignalObserver::SignalObserver() - : _oldsel(0) + : _oldsel(NULL) {} // Add this observer to the SPObject and remove it from any previous object @@ -13,17 +13,21 @@ void SignalObserver::set(SPObject* o) { // XML Tree being used direcly in this function in the following code // while it shouldn't be + // Pointer to object is stored, so refcounting should be increased/decreased if(_oldsel) { if (_oldsel->getRepr()) { _oldsel->getRepr()->removeObserver(*this); } + sp_object_unref(_oldsel); + _oldsel = NULL; } if(o) { if (o->getRepr()) { o->getRepr()->addObserver(*this); + sp_object_ref(o); + _oldsel = o; } } - _oldsel = o; } void SignalObserver::notifyChildAdded(XML::Node&, XML::Node&, XML::Node*) -- cgit v1.2.3 From bf23e1b45a6ed8990ca3401064840159eeeb47cb Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Mon, 16 Jun 2014 20:26:07 +0200 Subject: SignalObserver: fix further refcounting issue in signal observer (bzr r13427) --- src/xml/helper-observer.cpp | 5 +++++ src/xml/helper-observer.h | 1 + 2 files changed, 6 insertions(+) (limited to 'src') diff --git a/src/xml/helper-observer.cpp b/src/xml/helper-observer.cpp index e56ddc6f8..957f3df0a 100644 --- a/src/xml/helper-observer.cpp +++ b/src/xml/helper-observer.cpp @@ -8,6 +8,11 @@ SignalObserver::SignalObserver() : _oldsel(NULL) {} +SignalObserver::~SignalObserver() +{ + set(NULL); // if _oldsel!=nullptr, remove observer and decrease refcount +} + // Add this observer to the SPObject and remove it from any previous object void SignalObserver::set(SPObject* o) { diff --git a/src/xml/helper-observer.h b/src/xml/helper-observer.h index e7881cd4d..2f70ba792 100644 --- a/src/xml/helper-observer.h +++ b/src/xml/helper-observer.h @@ -17,6 +17,7 @@ namespace Inkscape { { public: SignalObserver(); + ~SignalObserver(); // Add this observer to the SPObject and remove it from any previous object void set(SPObject* o); -- cgit v1.2.3 From ba32027677dee7700542b236410411fca62ba9c7 Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Mon, 16 Jun 2014 23:34:16 +0200 Subject: fixes to LPEKnot, now usable again. knotholder: if knot coords are non-finite, hide knot. used for hiding the lpeknot switcher knot if there are no crossings Fixed bugs: - https://launchpad.net/bugs/781893 (bzr r13428) --- src/knot-holder-entity.cpp | 16 ++++++++++------ src/live_effects/lpe-knot.cpp | 24 +++++++++++++----------- src/live_effects/lpe-knot.h | 1 - 3 files changed, 23 insertions(+), 18 deletions(-) (limited to 'src') diff --git a/src/knot-holder-entity.cpp b/src/knot-holder-entity.cpp index 6471124ec..6af5c6a56 100644 --- a/src/knot-holder-entity.cpp +++ b/src/knot-holder-entity.cpp @@ -80,13 +80,17 @@ KnotHolderEntity::~KnotHolderEntity() void KnotHolderEntity::update_knot() { - Geom::Affine const i2dt(item->i2dt_affine()); + Geom::Point knot_pos(knot_get()); + if (knot_pos.isFinite()) { + Geom::Point dp(knot_pos * item->i2dt_affine()); - Geom::Point dp(knot_get() * i2dt); - - _moved_connection.block(); - knot->setPosition(dp, SP_KNOT_STATE_NORMAL); - _moved_connection.unblock(); + _moved_connection.block(); + knot->setPosition(dp, SP_KNOT_STATE_NORMAL); + _moved_connection.unblock(); + } else { + // knot coords are non-finite, hide knot + knot->hide(); + } } Geom::Point diff --git a/src/live_effects/lpe-knot.cpp b/src/live_effects/lpe-knot.cpp index 581c632f5..cac3a9347 100644 --- a/src/live_effects/lpe-knot.cpp +++ b/src/live_effects/lpe-knot.cpp @@ -353,7 +353,11 @@ LPEKnot::LPEKnot(LivePathEffectObject *lpeobject) : add_other_stroke_width(_("_Crossing path stroke width"), _("Add crossed stroke width to the interruption size"), "add_other_stroke_width", &wr, this, true), switcher_size(_("S_witcher size:"), _("Orientation indicator/switcher size"), "switcher_size", &wr, this, 15), crossing_points_vector(_("Crossing Signs"), _("Crossings signs"), "crossing_points_vector", &wr, this), - gpaths(),gstroke_widths() + crossing_points(), + gpaths(), + gstroke_widths(), + selectedCrossing(0), + switcher(0.,0.) { // register all your parameters here, so Inkscape knows which parameters this effect has: registerParameter( dynamic_cast(&interruption_width) ); @@ -363,10 +367,6 @@ LPEKnot::LPEKnot(LivePathEffectObject *lpeobject) : registerParameter( dynamic_cast(&switcher_size) ); registerParameter( dynamic_cast(&crossing_points_vector) ); - crossing_points = LPEKnotNS::CrossingPoints(); - selectedCrossing = 0; - switcher = Geom::Point(0,0); - _provides_knotholder_entities = true; } @@ -386,9 +386,7 @@ LPEKnot::updateSwitcher(){ //std::cout<<"placing switcher at "<(); - gstroke_widths = std::vector(); + gpaths.clear(); + gstroke_widths.clear(); + collectPathsAndWidths(lpeitem, gpaths, gstroke_widths); // std::cout<<"\nPaths on input:\n"; @@ -586,7 +585,10 @@ LPEKnot::doBeforeEffect (SPLPEItem const* lpeitem) // std::cout< crossing_points_vector;//svg storage of crossing_points LPEKnotNS::CrossingPoints crossing_points;//topology representation of the knot. -- cgit v1.2.3 From b472007094a3724bef949ac45a6294d0e9cb8a01 Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Mon, 16 Jun 2014 23:39:13 +0200 Subject: LPEItem enabling/disabling: rewrite mechanism to be more robust. the previous nesting behavior was not used, and code relied on non-nesting behavior. (bzr r13429) --- src/sp-lpe-item.cpp | 28 ++++------------------------ src/sp-lpe-item.h | 11 +++++++---- 2 files changed, 11 insertions(+), 28 deletions(-) (limited to 'src') diff --git a/src/sp-lpe-item.cpp b/src/sp-lpe-item.cpp index bfecdcf98..ad0902967 100644 --- a/src/sp-lpe-item.cpp +++ b/src/sp-lpe-item.cpp @@ -50,8 +50,6 @@ #include /* LPEItem base class */ -static void sp_lpe_item_enable_path_effects(SPLPEItem *lpeitem, bool enable); - static void lpeobject_ref_modified(SPObject *href, guint flags, SPLPEItem *lpeitem); static void sp_lpe_item_create_original_path_recursive(SPLPEItem *lpeitem); @@ -115,7 +113,7 @@ void SPLPEItem::set(unsigned int key, gchar const* value) { this->current_path_effect = NULL; // Disable the path effects while populating the LPE list - sp_lpe_item_enable_path_effects(this, false); + enablePathEffects(false); // disconnect all modified listeners: for ( std::list::iterator mod_it = this->lpe_modified_connection_list->begin(); @@ -168,7 +166,7 @@ void SPLPEItem::set(unsigned int key, gchar const* value) { } } - sp_lpe_item_enable_path_effects(this, true); + enablePathEffects(true); } break; @@ -409,7 +407,7 @@ void SPLPEItem::addPathEffect(gchar *value, bool reset) sp_lpe_item_update_patheffect(this, false, true); // Disable the path effects while preparing the new lpe - sp_lpe_item_enable_path_effects(this, false); + enablePathEffects(false); // Add the new reference to the list of LPE references HRefList hreflist; @@ -446,7 +444,7 @@ void SPLPEItem::addPathEffect(gchar *value, bool reset) } //Enable the path effects now that everything is ready to apply the new path effect - sp_lpe_item_enable_path_effects(this, true); + enablePathEffects(true); // Apply the path effect sp_lpe_item_update_patheffect(this, true, true); @@ -942,24 +940,6 @@ bool SPLPEItem::forkPathEffectsIfNecessary(unsigned int nr_of_allowed_users) return forked; } -// Enable or disable the path effects of the item. -// The counter allows nested calls -static void sp_lpe_item_enable_path_effects(SPLPEItem *lpeitem, bool enable) -{ - if (enable) { - lpeitem->path_effects_enabled++; - } - else { - lpeitem->path_effects_enabled--; - } -} - -// Are the path effects enabled on this item ? -bool SPLPEItem::pathEffectsEnabled() const -{ - return path_effects_enabled > 0; -} - /* Local Variables: mode:c++ diff --git a/src/sp-lpe-item.h b/src/sp-lpe-item.h index 5a38fdd0b..da77ba2ca 100644 --- a/src/sp-lpe-item.h +++ b/src/sp-lpe-item.h @@ -39,11 +39,13 @@ namespace LivePathEffect{ typedef std::list PathEffectList; class SPLPEItem : public SPItem { +private: + mutable bool path_effects_enabled; // (mutable because preserves logical const-ness) + public: - SPLPEItem(); - virtual ~SPLPEItem(); + SPLPEItem(); + virtual ~SPLPEItem(); - int path_effects_enabled; PathEffectList* path_effect_list; std::list *lpe_modified_connection_list; // this list contains the connections for listening to lpeobject parameter changes @@ -72,7 +74,8 @@ public: bool performPathEffect(SPCurve *curve); - bool pathEffectsEnabled() const; + void enablePathEffects(bool enable) const { path_effects_enabled = enable; }; // (const because logically const) + bool pathEffectsEnabled() const { return path_effects_enabled; }; bool hasPathEffect() const; bool hasPathEffectOfType(int const type) const; bool hasPathEffectRecursive() const; -- cgit v1.2.3 From d960c55b5c993f9d43757a0a0b42a1fc8039c072 Mon Sep 17 00:00:00 2001 From: Nicolas Dufour Date: Wed, 18 Jun 2014 08:36:04 +0200 Subject: Extensions. Fix for Bug #433860 (Live preview doesn't work after updating the values many times). Fixed bugs: - https://launchpad.net/bugs/433860 (bzr r13430) --- src/extension/prefdialog.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/extension/prefdialog.cpp b/src/extension/prefdialog.cpp index 1b657f644..d1f83701f 100644 --- a/src/extension/prefdialog.cpp +++ b/src/extension/prefdialog.cpp @@ -212,6 +212,9 @@ PrefDialog::preview_toggle (void) { void PrefDialog::param_change (void) { if (_exEnv != NULL) { + if (!_effect->loaded()) { + _effect->set_state(Extension::STATE_LOADED); + } _timersig.disconnect(); _timersig = Glib::signal_timeout().connect(sigc::mem_fun(this, &PrefDialog::param_timer_expire), 250, /* ms */ -- cgit v1.2.3 From 358d04f20095b64680c378af0057d4971c6cf8cc Mon Sep 17 00:00:00 2001 From: Bryce Harrington Date: Wed, 18 Jun 2014 11:32:51 -0700 Subject: packaging: Update copyrights for the release (bzr r13431) --- src/inkscape.rc | 2 +- src/inkview.rc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/inkscape.rc b/src/inkscape.rc index efa360c8d..395ef39e1 100644 --- a/src/inkscape.rc +++ b/src/inkscape.rc @@ -15,7 +15,7 @@ BEGIN VALUE "FileDescription", "Inkscape" VALUE "FileVersion", "0.48+devel" VALUE "InternalName", "Inkscape" - VALUE "LegalCopyright", "© 2012 Inkscape" + VALUE "LegalCopyright", "© 2014 Inkscape" VALUE "ProductName", "Inkscape" VALUE "ProductVersion", "0.48+devel" END diff --git a/src/inkview.rc b/src/inkview.rc index f1fa92247..fd7eb50a1 100644 --- a/src/inkview.rc +++ b/src/inkview.rc @@ -15,7 +15,7 @@ BEGIN VALUE "FileDescription", "Inkview" VALUE "FileVersion", "0.48+devel" VALUE "InternalName", "Inkview" - VALUE "LegalCopyright", "© 2012 Inkscape" + VALUE "LegalCopyright", "© 2014 Inkscape" VALUE "ProductName", "Inkview" VALUE "ProductVersion", "0.48+devel" END -- cgit v1.2.3 From 78ff8ee1445ce4b4d72e273358fbef6d0105f426 Mon Sep 17 00:00:00 2001 From: "Liam P. White" Date: Thu, 19 Jun 2014 16:37:29 -0400 Subject: Fix a crash where the canvas does not have a valid main element (bzr r13433) --- src/widgets/desktop-widget.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/widgets/desktop-widget.cpp b/src/widgets/desktop-widget.cpp index 583dbec85..1b4648286 100644 --- a/src/widgets/desktop-widget.cpp +++ b/src/widgets/desktop-widget.cpp @@ -1246,6 +1246,9 @@ SPDesktopWidget::shutdown() */ void SPDesktopWidget::requestCanvasUpdate() { + // ^^ also this->desktop != 0 + g_return_if_fail(this->desktop != NULL); + g_return_if_fail(this->desktop->main != NULL); gtk_widget_queue_draw (GTK_WIDGET (SP_CANVAS_ITEM (this->desktop->main)->canvas)); } -- cgit v1.2.3 From 106e15e457a9b514a34bf6321d6c5cc386c2f569 Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Sat, 21 Jun 2014 21:32:06 +0200 Subject: Add new named color 'rebeccapurple' (CSS4 Color). (bzr r13435) --- src/libcroco/cr-rgb.c | 1 + src/svg/svg-color.cpp | 1 + 2 files changed, 2 insertions(+) (limited to 'src') diff --git a/src/libcroco/cr-rgb.c b/src/libcroco/cr-rgb.c index 06e61ba41..537343579 100644 --- a/src/libcroco/cr-rgb.c +++ b/src/libcroco/cr-rgb.c @@ -150,6 +150,7 @@ static const CRRgb gv_standard_colors[] = { {(const guchar*)"plum", 221, 160, 221, FALSE, FALSE, FALSE, {0,0,0}}, {(const guchar*)"powderblue", 176, 224, 230, FALSE, FALSE, FALSE, {0,0,0}}, {(const guchar*)"purple", 128, 0, 128, FALSE, FALSE, FALSE, {0,0,0}}, + {(const guchar*)"rebeccapurple", 102, 51, 153, FALSE, FALSE, FALSE, {0,0,0}}, {(const guchar*)"red", 255, 0, 0, FALSE, FALSE, FALSE, {0,0,0}}, {(const guchar*)"rosybrown", 188, 143, 143, FALSE, FALSE, FALSE, {0,0,0}}, {(const guchar*)"royalblue", 65, 105, 225, FALSE, FALSE, FALSE, {0,0,0}}, diff --git a/src/svg/svg-color.cpp b/src/svg/svg-color.cpp index 57f542373..ca94c241f 100644 --- a/src/svg/svg-color.cpp +++ b/src/svg/svg-color.cpp @@ -173,6 +173,7 @@ static SPSVGColor const sp_svg_color_named[] = { { 0xDDA0DD, "plum" }, { 0xB0E0E6, "powderblue" }, { 0x800080, "purple" }, + { 0x663399, "rebeccapurple" }, { 0xFF0000, "red" }, { 0xBC8F8F, "rosybrown" }, { 0x4169E1, "royalblue" }, -- cgit v1.2.3 From 9494f126c9a54446dd5d049bfc5704c702dc9047 Mon Sep 17 00:00:00 2001 From: "Liam P. White" Date: Sun, 22 Jun 2014 18:21:48 -0400 Subject: Fix for ungrouping/non-LPEItem masks Fixed bugs: - https://launchpad.net/bugs/1333020 (bzr r13436) --- src/sp-lpe-item.cpp | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/sp-lpe-item.cpp b/src/sp-lpe-item.cpp index ad0902967..e04d8f841 100644 --- a/src/sp-lpe-item.cpp +++ b/src/sp-lpe-item.cpp @@ -337,16 +337,24 @@ lpeobject_ref_modified(SPObject */*href*/, guint /*flags*/, SPLPEItem *lpeitem) static void sp_lpe_item_create_original_path_recursive(SPLPEItem *lpeitem) { + g_return_if_fail(lpeitem != NULL); SPMask * mask = lpeitem->mask_ref->getObject(); - if(mask) + + if (mask) { - sp_lpe_item_create_original_path_recursive(SP_LPE_ITEM(mask->firstChild())); + if (SPLPEItem* maskChild = dynamic_cast(mask->firstChild())) { + sp_lpe_item_create_original_path_recursive(maskChild); + } } + SPClipPath * clipPath = lpeitem->clip_ref->getObject(); - if(clipPath) + if (clipPath) { - sp_lpe_item_create_original_path_recursive(SP_LPE_ITEM(clipPath->firstChild())); + if (SPLPEItem* clipChild = dynamic_cast(clipPath->firstChild())) { + sp_lpe_item_create_original_path_recursive(clipChild); + } } + if (SP_IS_GROUP(lpeitem)) { GSList const *item_list = sp_item_group_item_list(SP_GROUP(lpeitem)); for ( GSList const *iter = item_list; iter; iter = iter->next ) { @@ -367,15 +375,22 @@ sp_lpe_item_create_original_path_recursive(SPLPEItem *lpeitem) static void sp_lpe_item_cleanup_original_path_recursive(SPLPEItem *lpeitem) { + g_return_if_fail(lpeitem != NULL); SPMask * mask = lpeitem->mask_ref->getObject(); - if(mask) + + if (mask) { - sp_lpe_item_cleanup_original_path_recursive(SP_LPE_ITEM(mask->firstChild())); + if (SPLPEItem* maskChild = dynamic_cast(mask->firstChild())) { + sp_lpe_item_cleanup_original_path_recursive(maskChild); + } } + SPClipPath * clipPath = lpeitem->clip_ref->getObject(); - if(clipPath) + if (clipPath) { - sp_lpe_item_cleanup_original_path_recursive(SP_LPE_ITEM(clipPath->firstChild())); + if (SPLPEItem* clipChild = dynamic_cast(clipPath->firstChild())) { + sp_lpe_item_cleanup_original_path_recursive(clipChild); + } } if (SP_IS_GROUP(lpeitem)) { -- cgit v1.2.3 From 24b274159b8a31784883b5e440457ab90d6107d6 Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Tue, 24 Jun 2014 18:59:15 +0200 Subject: revert rev. 13429 that broke LPE Bend, Envelope, etc etc. very sorry about that. (bzr r13439) --- src/sp-lpe-item.cpp | 28 ++++++++++++++++++++++++---- src/sp-lpe-item.h | 11 ++++------- 2 files changed, 28 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/sp-lpe-item.cpp b/src/sp-lpe-item.cpp index e04d8f841..a5d70d573 100644 --- a/src/sp-lpe-item.cpp +++ b/src/sp-lpe-item.cpp @@ -50,6 +50,8 @@ #include /* LPEItem base class */ +static void sp_lpe_item_enable_path_effects(SPLPEItem *lpeitem, bool enable); + static void lpeobject_ref_modified(SPObject *href, guint flags, SPLPEItem *lpeitem); static void sp_lpe_item_create_original_path_recursive(SPLPEItem *lpeitem); @@ -113,7 +115,7 @@ void SPLPEItem::set(unsigned int key, gchar const* value) { this->current_path_effect = NULL; // Disable the path effects while populating the LPE list - enablePathEffects(false); + sp_lpe_item_enable_path_effects(this, false); // disconnect all modified listeners: for ( std::list::iterator mod_it = this->lpe_modified_connection_list->begin(); @@ -166,7 +168,7 @@ void SPLPEItem::set(unsigned int key, gchar const* value) { } } - enablePathEffects(true); + sp_lpe_item_enable_path_effects(this, true); } break; @@ -422,7 +424,7 @@ void SPLPEItem::addPathEffect(gchar *value, bool reset) sp_lpe_item_update_patheffect(this, false, true); // Disable the path effects while preparing the new lpe - enablePathEffects(false); + sp_lpe_item_enable_path_effects(this, false); // Add the new reference to the list of LPE references HRefList hreflist; @@ -459,7 +461,7 @@ void SPLPEItem::addPathEffect(gchar *value, bool reset) } //Enable the path effects now that everything is ready to apply the new path effect - enablePathEffects(true); + sp_lpe_item_enable_path_effects(this, true); // Apply the path effect sp_lpe_item_update_patheffect(this, true, true); @@ -955,6 +957,24 @@ bool SPLPEItem::forkPathEffectsIfNecessary(unsigned int nr_of_allowed_users) return forked; } +// Enable or disable the path effects of the item. +// The counter allows nested calls +static void sp_lpe_item_enable_path_effects(SPLPEItem *lpeitem, bool enable) +{ + if (enable) { + lpeitem->path_effects_enabled++; + } + else { + lpeitem->path_effects_enabled--; + } +} + +// Are the path effects enabled on this item ? +bool SPLPEItem::pathEffectsEnabled() const +{ + return path_effects_enabled > 0; +} + /* Local Variables: mode:c++ diff --git a/src/sp-lpe-item.h b/src/sp-lpe-item.h index da77ba2ca..5a38fdd0b 100644 --- a/src/sp-lpe-item.h +++ b/src/sp-lpe-item.h @@ -39,13 +39,11 @@ namespace LivePathEffect{ typedef std::list PathEffectList; class SPLPEItem : public SPItem { -private: - mutable bool path_effects_enabled; // (mutable because preserves logical const-ness) - public: - SPLPEItem(); - virtual ~SPLPEItem(); + SPLPEItem(); + virtual ~SPLPEItem(); + int path_effects_enabled; PathEffectList* path_effect_list; std::list *lpe_modified_connection_list; // this list contains the connections for listening to lpeobject parameter changes @@ -74,8 +72,7 @@ public: bool performPathEffect(SPCurve *curve); - void enablePathEffects(bool enable) const { path_effects_enabled = enable; }; // (const because logically const) - bool pathEffectsEnabled() const { return path_effects_enabled; }; + bool pathEffectsEnabled() const; bool hasPathEffect() const; bool hasPathEffectOfType(int const type) const; bool hasPathEffectRecursive() const; -- cgit v1.2.3 From 6829ce76e2ab77859c1a5fdacbb2fa71109d65b0 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Fri, 27 Jun 2014 18:28:46 +0200 Subject: Remove the incorrect fix for the bug 1241902 (bzr r13441) --- src/box3d-side.cpp | 2 -- src/selection-chemistry.cpp | 4 ---- src/sp-ellipse.cpp | 2 -- src/sp-item-group.cpp | 36 +++++++----------------------------- src/sp-item-group.h | 2 +- src/sp-lpe-item.cpp | 35 +++-------------------------------- src/sp-path.cpp | 2 -- src/sp-spiral.cpp | 2 -- src/sp-star.cpp | 2 -- 9 files changed, 11 insertions(+), 76 deletions(-) (limited to 'src') diff --git a/src/box3d-side.cpp b/src/box3d-side.cpp index a5e7eaa94..dfccb63bf 100644 --- a/src/box3d-side.cpp +++ b/src/box3d-side.cpp @@ -213,8 +213,6 @@ void Box3DSide::set_shape() { bool success = this->performPathEffect(c_lpe); if (success) { - sp_lpe_item_apply_to_mask(this); - sp_lpe_item_apply_to_clippath(this); this->setCurveInsync(c_lpe, TRUE); } diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp index a350dd7a7..868a9d743 100644 --- a/src/selection-chemistry.cpp +++ b/src/selection-chemistry.cpp @@ -3950,10 +3950,6 @@ void sp_selection_unset_mask(SPDesktop *desktop, bool apply_clip_path) { for ( SPObject *child = obj->firstChild() ; child; child = child->getNext() ) { // Collect all clipped paths and masks within a single group Inkscape::XML::Node *copy = SP_OBJECT(child)->getRepr()->duplicate(xml_doc); - if(copy->attribute("inkscape:original-d")) - { - copy->setAttribute("d", copy->attribute("inkscape:original-d")); - } items_to_move = g_slist_prepend(items_to_move, copy); } diff --git a/src/sp-ellipse.cpp b/src/sp-ellipse.cpp index 428e0e3dd..cda59e057 100644 --- a/src/sp-ellipse.cpp +++ b/src/sp-ellipse.cpp @@ -467,8 +467,6 @@ void SPGenericEllipse::set_shape() bool success = this->performPathEffect(c_lpe); if (success) { - sp_lpe_item_apply_to_mask(this); - sp_lpe_item_apply_to_clippath(this); this->setCurveInsync(c_lpe, TRUE); } diff --git a/src/sp-item-group.cpp b/src/sp-item-group.cpp index b3db0c1d7..2cfe97db8 100644 --- a/src/sp-item-group.cpp +++ b/src/sp-item-group.cpp @@ -778,31 +778,17 @@ void SPGroup::update_patheffect(bool write) { } } - -void -sp_gslist_update_by_clip_or_mask(GSList *item_list,SPItem * item) -{ - if(item->mask_ref->getObject()) { - SPObject * clipormask = item->mask_ref->getObject()->firstChild(); - item_list = g_slist_append(item_list,clipormask); - } - if(item->clip_ref->getObject()) { - SPObject * clipormask = item->clip_ref->getObject()->firstChild(); - item_list = g_slist_append(item_list,clipormask); - } -} - static void sp_group_perform_patheffect(SPGroup *group, SPGroup *topgroup, bool write) { - GSList *item_list = sp_item_group_item_list(group); - sp_gslist_update_by_clip_or_mask(item_list,group); - for ( GSList *iter = item_list; iter; iter = iter->next ) { + GSList const *item_list = sp_item_group_item_list(SP_GROUP(group)); + + for ( GSList const *iter = item_list; iter; iter = iter->next ) { SPObject *subitem = static_cast(iter->data); + if (SP_IS_GROUP(subitem)) { sp_group_perform_patheffect(SP_GROUP(subitem), topgroup, write); } else if (SP_IS_SHAPE(subitem)) { - sp_gslist_update_by_clip_or_mask(item_list,SP_ITEM(subitem)); SPCurve * c = NULL; if (SP_IS_PATH(subitem)) { @@ -813,17 +799,9 @@ sp_group_perform_patheffect(SPGroup *group, SPGroup *topgroup, bool write) // only run LPEs when the shape has a curve defined if (c) { - if(SP_IS_MASK(subitem->parent) || SP_IS_CLIPPATH(subitem->parent)) { - c->transform(i2anc_affine(group, topgroup)); - } else { - c->transform(i2anc_affine(subitem, topgroup)); - } + c->transform(i2anc_affine(subitem, topgroup)); SP_LPE_ITEM(topgroup)->performPathEffect(c); - if(SP_IS_MASK(subitem->parent) || SP_IS_CLIPPATH(subitem->parent)) { - c->transform(i2anc_affine(group, topgroup).inverse()); - } else { - c->transform(i2anc_affine(subitem, topgroup).inverse()); - } + c->transform(i2anc_affine(subitem, topgroup).inverse()); SP_SHAPE(subitem)->setCurve(c, TRUE); if (write) { @@ -831,7 +809,7 @@ sp_group_perform_patheffect(SPGroup *group, SPGroup *topgroup, bool write) gchar *str = sp_svg_write_path(c->get_pathvector()); repr->setAttribute("d", str); #ifdef GROUP_VERBOSE - g_message("sp_group_perform_patheffect writes 'd' attribute"); +g_message("sp_group_perform_patheffect writes 'd' attribute"); #endif g_free(str); } diff --git a/src/sp-item-group.h b/src/sp-item-group.h index adec35571..2004a72b8 100644 --- a/src/sp-item-group.h +++ b/src/sp-item-group.h @@ -88,7 +88,7 @@ public: void sp_item_group_ungroup (SPGroup *group, GSList **children, bool do_done = true); -void sp_gslist_update_by_clip_or_mask(GSList *item_list, SPItem * item); + GSList *sp_item_group_item_list (SPGroup *group); SPObject *sp_item_group_get_child_by_name (SPGroup *group, SPObject *ref, const gchar *name); diff --git a/src/sp-lpe-item.cpp b/src/sp-lpe-item.cpp index a5d70d573..321d2fc42 100644 --- a/src/sp-lpe-item.cpp +++ b/src/sp-lpe-item.cpp @@ -340,22 +340,6 @@ static void sp_lpe_item_create_original_path_recursive(SPLPEItem *lpeitem) { g_return_if_fail(lpeitem != NULL); - SPMask * mask = lpeitem->mask_ref->getObject(); - - if (mask) - { - if (SPLPEItem* maskChild = dynamic_cast(mask->firstChild())) { - sp_lpe_item_create_original_path_recursive(maskChild); - } - } - - SPClipPath * clipPath = lpeitem->clip_ref->getObject(); - if (clipPath) - { - if (SPLPEItem* clipChild = dynamic_cast(clipPath->firstChild())) { - sp_lpe_item_create_original_path_recursive(clipChild); - } - } if (SP_IS_GROUP(lpeitem)) { GSList const *item_list = sp_item_group_item_list(SP_GROUP(lpeitem)); @@ -378,22 +362,6 @@ static void sp_lpe_item_cleanup_original_path_recursive(SPLPEItem *lpeitem) { g_return_if_fail(lpeitem != NULL); - SPMask * mask = lpeitem->mask_ref->getObject(); - - if (mask) - { - if (SPLPEItem* maskChild = dynamic_cast(mask->firstChild())) { - sp_lpe_item_cleanup_original_path_recursive(maskChild); - } - } - - SPClipPath * clipPath = lpeitem->clip_ref->getObject(); - if (clipPath) - { - if (SPLPEItem* clipChild = dynamic_cast(clipPath->firstChild())) { - sp_lpe_item_cleanup_original_path_recursive(clipChild); - } - } if (SP_IS_GROUP(lpeitem)) { GSList const *item_list = sp_item_group_item_list(SP_GROUP(lpeitem)); @@ -640,6 +608,9 @@ bool SPLPEItem::hasPathEffectRecursive() const } } +//The next 3 functions are because the revert of the bug 1241902 +//for the moment not used + void sp_lpe_item_apply_to_clippath(SPItem * item) { diff --git a/src/sp-path.cpp b/src/sp-path.cpp index 4a68b82c7..cbb61b0f6 100644 --- a/src/sp-path.cpp +++ b/src/sp-path.cpp @@ -310,8 +310,6 @@ g_message("sp_path_update_patheffect"); bool success = this->performPathEffect(curve); if (success && write) { - sp_lpe_item_apply_to_mask(this); - sp_lpe_item_apply_to_clippath(this); // could also do this->getRepr()->updateRepr(); but only the d attribute needs updating. #ifdef PATH_VERBOSE g_message("sp_path_update_patheffect writes 'd' attribute"); diff --git a/src/sp-spiral.cpp b/src/sp-spiral.cpp index 8d4a37bf0..9ef73d56d 100644 --- a/src/sp-spiral.cpp +++ b/src/sp-spiral.cpp @@ -385,8 +385,6 @@ void SPSpiral::set_shape() { bool success = this->performPathEffect(c_lpe); if (success) { - sp_lpe_item_apply_to_mask(this); - sp_lpe_item_apply_to_clippath(this); this->setCurveInsync( c_lpe, TRUE); } diff --git a/src/sp-star.cpp b/src/sp-star.cpp index 170a863b5..eac33ed7b 100644 --- a/src/sp-star.cpp +++ b/src/sp-star.cpp @@ -465,8 +465,6 @@ void SPStar::set_shape() { bool success = this->performPathEffect(c_lpe); if (success) { - sp_lpe_item_apply_to_mask(this); - sp_lpe_item_apply_to_clippath(this); this->setCurveInsync( c_lpe, TRUE); } -- cgit v1.2.3 From 96fec2043bbac0293fb30486d6c6a8650190abff Mon Sep 17 00:00:00 2001 From: Nicolas Dufour Date: Sun, 29 Jun 2014 09:21:44 +0200 Subject: Layers. Fix for Bug #1326131 (Can't delete layer from context menu). Fixed bugs: - https://launchpad.net/bugs/1326131 (bzr r13442) --- src/ui/dialog/layers.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/ui/dialog/layers.cpp b/src/ui/dialog/layers.cpp index b5dac0595..65351cb68 100644 --- a/src/ui/dialog/layers.cpp +++ b/src/ui/dialog/layers.cpp @@ -926,9 +926,8 @@ LayersPanel::LayersPanel() : // ------------------------------------------------------- { - _watching.push_back( &_addPopupItem( targetDesktop, SP_VERB_LAYER_RENAME, 0, "Rename", (int)BUTTON_RENAME ) ); - _watching.push_back( &_addPopupItem( targetDesktop, SP_VERB_LAYER_DUPLICATE, 0, "Duplicate", (int)BUTTON_DUPLICATE ) ); _watching.push_back( &_addPopupItem( targetDesktop, SP_VERB_LAYER_NEW, 0, "New", (int)BUTTON_NEW ) ); + _watching.push_back( &_addPopupItem( targetDesktop, SP_VERB_LAYER_RENAME, 0, "Rename", (int)BUTTON_RENAME ) ); _popupMenu.append(*Gtk::manage(new Gtk::SeparatorMenuItem())); @@ -944,9 +943,14 @@ LayersPanel::LayersPanel() : _popupMenu.append(*Gtk::manage(new Gtk::SeparatorMenuItem())); - _watchingNonTop.push_back( &_addPopupItem( targetDesktop, SP_VERB_LAYER_RAISE, INKSCAPE_ICON("go-up"), "Up", (int)BUTTON_UP ) ); - _watchingNonBottom.push_back( &_addPopupItem( targetDesktop, SP_VERB_LAYER_LOWER, INKSCAPE_ICON("go-down"), "Down", (int)BUTTON_DOWN ) ); + _watchingNonTop.push_back( &_addPopupItem( targetDesktop, SP_VERB_LAYER_RAISE, INKSCAPE_ICON("layer-raise"), "Up", (int)BUTTON_UP ) ); + _watchingNonBottom.push_back( &_addPopupItem( targetDesktop, SP_VERB_LAYER_LOWER, INKSCAPE_ICON("layer-lower"), "Down", (int)BUTTON_DOWN ) ); + _popupMenu.append(*Gtk::manage(new Gtk::SeparatorMenuItem())); + + _watching.push_back( &_addPopupItem( targetDesktop, SP_VERB_LAYER_DUPLICATE, 0, "Duplicate", (int)BUTTON_DUPLICATE ) ); + _watching.push_back( &_addPopupItem( targetDesktop, SP_VERB_LAYER_DELETE, 0, "Delete", (int)BUTTON_DELETE ) ); + _popupMenu.show_all_children(); } // ------------------------------------------------------- -- cgit v1.2.3 From 5382e1fb57cb06f5d4a21e3e553ccdd9395014f5 Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Sun, 29 Jun 2014 17:12:27 +0200 Subject: Enable rendering of new filter blend modes (but don't add them to GUI). (bzr r13443) --- src/display/nr-filter-blend.cpp | 9 ++------- src/display/nr-filter-blend.h | 2 -- src/filter-enums.cpp | 8 +++++--- src/filters/blend.cpp | 8 -------- src/ui/widget/filter-effect-chooser.cpp | 13 +++++-------- 5 files changed, 12 insertions(+), 28 deletions(-) (limited to 'src') diff --git a/src/display/nr-filter-blend.cpp b/src/display/nr-filter-blend.cpp index 099816bce..25aea6f13 100644 --- a/src/display/nr-filter-blend.cpp +++ b/src/display/nr-filter-blend.cpp @@ -83,8 +83,7 @@ void FilterBlend::render_cairo(FilterSlot &slot) case BLEND_LIGHTEN: cairo_set_operator(out_ct, CAIRO_OPERATOR_LIGHTEN); break; -#ifdef WITH_CSSBLEND - // NEW + // New in CSS Compositing and Blending Level 1 case BLEND_OVERLAY: cairo_set_operator(out_ct, CAIRO_OPERATOR_OVERLAY); break; @@ -118,7 +117,6 @@ void FilterBlend::render_cairo(FilterSlot &slot) case BLEND_LUMINOSITY: cairo_set_operator(out_ct, CAIRO_OPERATOR_HSL_LUMINOSITY); break; -#endif case BLEND_NORMAL: default: @@ -167,15 +165,12 @@ void FilterBlend::set_input(int input, int slot) { void FilterBlend::set_mode(FilterBlendMode mode) { if (mode == BLEND_NORMAL || mode == BLEND_MULTIPLY || mode == BLEND_SCREEN || mode == BLEND_DARKEN || - mode == BLEND_LIGHTEN -#ifdef WITH_CSSBLEND - || mode == BLEND_OVERLAY || + mode == BLEND_LIGHTEN || mode == BLEND_OVERLAY || mode == BLEND_COLORDODGE || mode == BLEND_COLORBURN || mode == BLEND_HARDLIGHT || mode == BLEND_SOFTLIGHT || mode == BLEND_DIFFERENCE || mode == BLEND_EXCLUSION || mode == BLEND_HUE || mode == BLEND_SATURATION || mode == BLEND_COLOR || mode == BLEND_LUMINOSITY -#endif ) { _blend_mode = mode; diff --git a/src/display/nr-filter-blend.h b/src/display/nr-filter-blend.h index 0a2927d87..c0504993b 100644 --- a/src/display/nr-filter-blend.h +++ b/src/display/nr-filter-blend.h @@ -28,7 +28,6 @@ enum FilterBlendMode { BLEND_SCREEN, BLEND_DARKEN, BLEND_LIGHTEN, -#ifdef WITH_CSSBLEND // New in CSS Compositing and Blending Level 1 BLEND_OVERLAY, BLEND_COLORDODGE, @@ -41,7 +40,6 @@ enum FilterBlendMode { BLEND_SATURATION, BLEND_COLOR, BLEND_LUMINOSITY, -#endif BLEND_ENDMODE, }; diff --git a/src/filter-enums.cpp b/src/filter-enums.cpp index 7ee57f7fa..09a1a7614 100644 --- a/src/filter-enums.cpp +++ b/src/filter-enums.cpp @@ -53,7 +53,6 @@ const EnumData BlendModeData[Inkscape::Filte {Inkscape::Filters::BLEND_SCREEN, _("Screen"), "screen"}, {Inkscape::Filters::BLEND_DARKEN, _("Darken"), "darken"}, {Inkscape::Filters::BLEND_LIGHTEN, _("Lighten"), "lighten"}, -#ifdef WITH_CSSBLEND // New in Compositing and Blending Level 1 {Inkscape::Filters::BLEND_OVERLAY, _("Overlay"), "overlay"}, {Inkscape::Filters::BLEND_COLORDODGE, _("Color Dodge"), "color-dodge"}, @@ -66,10 +65,13 @@ const EnumData BlendModeData[Inkscape::Filte {Inkscape::Filters::BLEND_SATURATION, _("Saturation"), "saturation"}, {Inkscape::Filters::BLEND_COLOR, _("Color"), "color"}, {Inkscape::Filters::BLEND_LUMINOSITY, _("Luminosity"), "luminosity"} -#endif }; +#ifdef WITH_CSSBLEND const EnumDataConverter BlendModeConverter(BlendModeData, Inkscape::Filters::BLEND_ENDMODE); - +#else +// Disable new blend modes in GUI until widely implemented. +const EnumDataConverter BlendModeConverter(BlendModeData, Inkscape::Filters::BLEND_OVERLAY); +#endif const EnumData ColorMatrixTypeData[Inkscape::Filters::COLORMATRIX_ENDTYPE] = { {Inkscape::Filters::COLORMATRIX_MATRIX, _("Matrix"), "matrix"}, diff --git a/src/filters/blend.cpp b/src/filters/blend.cpp index 5c78f4f9f..fd5a9871e 100644 --- a/src/filters/blend.cpp +++ b/src/filters/blend.cpp @@ -96,23 +96,18 @@ static Inkscape::Filters::FilterBlendMode sp_feBlend_readmode(gchar const *value case 's': if (strncmp(value, "screen", 6) == 0) return Inkscape::Filters::BLEND_SCREEN; -#ifdef WITH_CSSBLEND if (strncmp(value, "saturation", 6) == 0) return Inkscape::Filters::BLEND_SATURATION; -#endif break; case 'd': if (strncmp(value, "darken", 6) == 0) return Inkscape::Filters::BLEND_DARKEN; -#ifdef WITH_CSSBLEND if (strncmp(value, "difference", 10) == 0) return Inkscape::Filters::BLEND_DIFFERENCE; -#endif break; case 'l': if (strncmp(value, "lighten", 7) == 0) return Inkscape::Filters::BLEND_LIGHTEN; -#ifdef WITH_CSSBLEND if (strncmp(value, "luminosity", 10) == 0) return Inkscape::Filters::BLEND_LUMINOSITY; break; @@ -137,7 +132,6 @@ static Inkscape::Filters::FilterBlendMode sp_feBlend_readmode(gchar const *value case 'e': if (strncmp(value, "exclusion", 10) == 0) return Inkscape::Filters::BLEND_EXCLUSION; -#endif default: std::cout << "Inkscape::Filters::FilterBlendMode: Unimplemented mode: " << value << std::endl; // do nothing by default @@ -244,7 +238,6 @@ Inkscape::XML::Node* SPFeBlend::write(Inkscape::XML::Document *doc, Inkscape::XM mode = "darken"; break; case Inkscape::Filters::BLEND_LIGHTEN: mode = "lighten"; break; -#ifdef WITH_CSSBLEND // New case Inkscape::Filters::BLEND_OVERLAY: mode = "overlay"; break; @@ -268,7 +261,6 @@ Inkscape::XML::Node* SPFeBlend::write(Inkscape::XML::Document *doc, Inkscape::XM mode = "color"; break; case Inkscape::Filters::BLEND_LUMINOSITY: mode = "luminosity"; break; -#endif default: mode = 0; } diff --git a/src/ui/widget/filter-effect-chooser.cpp b/src/ui/widget/filter-effect-chooser.cpp index 65706a9dc..78988a041 100644 --- a/src/ui/widget/filter-effect-chooser.cpp +++ b/src/ui/widget/filter-effect-chooser.cpp @@ -56,15 +56,12 @@ const Glib::ustring SimpleFilterModifier::get_blend_mode() if (!(_flags & BLEND)) { return "normal"; } - if (_blend.get_active_row_number() == 5) { + + const Util::EnumData *d = _blend.get_active_data(); + if (d) { + return _blend.get_active_data()->key; + } else return "normal"; - } else { - const Util::EnumData *d = _blend.get_active_data(); - if (d) { - return _blend.get_active_data()->key; - } else - return "normal"; - } } void SimpleFilterModifier::set_blend_mode(const int val) -- cgit v1.2.3 From df0fdb31cb60c71777db0f75195e9f43cd8ba6c5 Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Mon, 30 Jun 2014 01:27:37 +0200 Subject: fix crash bug with connectors because of constructor "ConnRef(Router *router, const unsigned int id)", _srcVert and _dstVert can be NULL, and _active can be false. this constructor seems unfinished, but is used elsewhere in the code. hence the crash. Fixed bugs: - https://launchpad.net/bugs/977003 (bzr r13444) --- src/libavoid/connector.cpp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/libavoid/connector.cpp b/src/libavoid/connector.cpp index 8dcb66f2d..b8c99a48c 100644 --- a/src/libavoid/connector.cpp +++ b/src/libavoid/connector.cpp @@ -442,11 +442,11 @@ void ConnRef::makeActive(void) void ConnRef::makeInactive(void) { - COLA_ASSERT(_active); - - // Remove from connRefs list. - _router->connRefs.erase(_pos); - _active = false; + if (_active) { + // Remove from connRefs list. + _router->connRefs.erase(_pos); + _active = false; + } } @@ -553,8 +553,12 @@ void ConnRef::unInitialise(void) void ConnRef::removeFromGraph(void) { - _srcVert->removeFromGraph(); - _dstVert->removeFromGraph(); + if (_srcVert) { + _srcVert->removeFromGraph(); + } + if (_dstVert) { + _dstVert->removeFromGraph(); + } } -- cgit v1.2.3 From 6351d4ea2ea398e0096c14b3ba57ca28dfd2f8a3 Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Tue, 1 Jul 2014 23:58:08 +0200 Subject: Fix pentool backspace bug. Thanks Jabier Fixed bugs: - https://launchpad.net/bugs/1336561 (bzr r13445) --- src/ui/tools/pen-tool.cpp | 35 +++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/ui/tools/pen-tool.cpp b/src/ui/tools/pen-tool.cpp index b089065e8..70cbcaf0d 100644 --- a/src/ui/tools/pen-tool.cpp +++ b/src/ui/tools/pen-tool.cpp @@ -55,15 +55,15 @@ static bool pen_within_tolerance = false; static int pen_last_paraxial_dir = 0; // last used direction in horizontal/vertical mode; 0 = horizontal, 1 = vertical namespace { - ToolBase* createPenContext() { - return new PenTool(); - } + ToolBase* createPenContext() { + return new PenTool(); + } - bool penContextRegistered = ToolFactory::instance().registerObject("/tools/freehand/pen", createPenContext); + bool penContextRegistered = ToolFactory::instance().registerObject("/tools/freehand/pen", createPenContext); } const std::string& PenTool::getPrefsPath() { - return PenTool::prefsPath; + return PenTool::prefsPath; } const std::string PenTool::prefsPath = "/tools/freehand/pen"; @@ -277,7 +277,7 @@ bool PenTool::item_handler(SPItem* item, GdkEvent* event) { } if (!ret) { - ret = FreehandBase::item_handler(item, event); + ret = FreehandBase::item_handler(item, event); } return ret; @@ -315,7 +315,7 @@ bool PenTool::root_handler(GdkEvent* event) { } if (!ret) { - ret = FreehandBase::root_handler(event); + ret = FreehandBase::root_handler(event); } return ret; @@ -1061,8 +1061,9 @@ bool PenTool::_handleKeyPress(GdkEvent *event) { this->red_curve->reset(); // Destroy topmost green bpath if (this->green_bpaths) { - if (this->green_bpaths->data) + if (this->green_bpaths->data) { sp_canvas_item_destroy(SP_CANVAS_ITEM(this->green_bpaths->data)); + } this->green_bpaths = g_slist_remove(this->green_bpaths, this->green_bpaths->data); } // Get last segment @@ -1078,11 +1079,21 @@ bool PenTool::_handleKeyPress(GdkEvent *event) { } else { this->p[1] = this->p[0]; } - Geom::Point const pt(( this->npoints < 4 - ? (Geom::Point)(crv->finalPoint()) - : this->p[3] )); + Geom::Point const pt( (this->npoints < 4) ? crv->finalPoint() : this->p[3] ); this->npoints = 2; - this->green_curve->backspace(); + // delete the last segment of the green curve + if (this->green_curve->get_segment_count() == 1) { + this->npoints = 5; + if (this->green_bpaths) { + if (this->green_bpaths->data) { + sp_canvas_item_destroy(SP_CANVAS_ITEM(this->green_bpaths->data)); + } + this->green_bpaths = g_slist_remove(this->green_bpaths, this->green_bpaths->data); + } + this->green_curve->reset(); + } else { + this->green_curve->backspace(); + } sp_canvas_item_hide(this->c0); sp_canvas_item_hide(this->c1); sp_canvas_item_hide(this->cl0); -- cgit v1.2.3 From c5a3e612c363f761171123cf62f65c85808c296e Mon Sep 17 00:00:00 2001 From: Diederik van Lierop Date: Sat, 5 Jul 2014 15:23:33 +0200 Subject: Fix regression that prevented snapping back to original location, caused by rev. 13333 Fixed bugs: - https://launchpad.net/bugs/1337170 (bzr r13446) --- src/seltrans.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/seltrans.cpp b/src/seltrans.cpp index d6f31f073..d16e02e42 100644 --- a/src/seltrans.cpp +++ b/src/seltrans.cpp @@ -377,12 +377,6 @@ void Inkscape::SelTrans::transform(Geom::Affine const &rel_affine, Geom::Point c g_return_if_fail(_grabbed); g_return_if_fail(!_empty); - // E.g. scaling a perfectly vertical line in horizontal direction will not work, and will produce an identity affine - - if (rel_affine.isIdentity()) { - return; - } - Geom::Affine const affine( Geom::Translate(-norm) * rel_affine * Geom::Translate(norm) ); if (_show == SHOW_CONTENT) { @@ -1327,6 +1321,16 @@ void Inkscape::SelTrans::stretch(SPSelTransHandle const &/*handle*/, Geom::Point void Inkscape::SelTrans::scale(Geom::Point &/*pt*/, guint /*state*/) { + // E.g. scaling a perfectly vertical line in horizontal direction will not work, and will produce an identity affine + // Applying a transformation is useless, so we will not attempt to do so because this might trigger other bugs + // (see https://bugs.launchpad.net/inkscape/+bug/1256597) + // We check for this here and not in transform because identity transformations are perfectly fine for for example + // translations (e.g. a translation of (0,0), which occurs when snapping a point back to its original location) + + if (_absolute_affine.isIdentity()) { + return; + } + transform(_absolute_affine, Geom::Point(0, 0)); // we have already accounted for origin, so pass 0,0 } -- cgit v1.2.3 From 88e1060e6c6ebcd0ede7cc2841b899d84072aaa0 Mon Sep 17 00:00:00 2001 From: "Liam P. White" Date: Mon, 7 Jul 2014 22:10:45 -0400 Subject: Bugged powerstroke point array tried accessing points on a quickly diverging path Fixed bugs: - https://launchpad.net/bugs/1333465 (bzr r13447) --- src/live_effects/parameter/powerstrokepointarray.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/live_effects/parameter/powerstrokepointarray.cpp b/src/live_effects/parameter/powerstrokepointarray.cpp index fecdfeda8..647986da6 100644 --- a/src/live_effects/parameter/powerstrokepointarray.cpp +++ b/src/live_effects/parameter/powerstrokepointarray.cpp @@ -176,7 +176,10 @@ PowerStrokePointArrayParamKnotHolderEntity::knot_get() const Piecewise > const & n = _pparam->get_pwd2_normal(); Point offset_point = _pparam->_vector.at(_index); - + if (offset_point[X] > pwd2.size() || offset_point[X] < 0) { + g_warning("Broken powerstroke point at %f, I won't try to add that", offset_point[X]); + return Geom::Point(infinity(), infinity()); + } Point canvas_point = pwd2.valueAt(offset_point[X]) + offset_point[Y] * n.valueAt(offset_point[X]); return canvas_point; } -- cgit v1.2.3 From 94b74cf00f2d605cb8268d9fe05d0bad78077f1c Mon Sep 17 00:00:00 2001 From: Alvin Penner Date: Thu, 10 Jul 2014 15:13:09 -0400 Subject: refresh SPCurve in a cloned clip (Bug 1322940) Fixed bugs: - https://launchpad.net/bugs/1322940 (bzr r13448) --- src/sp-use.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/sp-use.cpp b/src/sp-use.cpp index e8fe3687f..7d908a66a 100644 --- a/src/sp-use.cpp +++ b/src/sp-use.cpp @@ -37,6 +37,7 @@ #include "sp-symbol.h" #include "sp-use.h" #include "sp-use-reference.h" +#include "sp-shape.h" namespace { SPObject* createUse() { @@ -176,6 +177,8 @@ Inkscape::XML::Node* SPUse::write(Inkscape::XML::Document *xml_doc, Inkscape::XM g_free(uri_string); } + if (SP_IS_SHAPE(this->child)) + SP_SHAPE(this->child)->set_shape(); // evaluate SPCurve of child return repr; } -- cgit v1.2.3 From 977a312f0979f34215f3c0ba5332d85b257d271c Mon Sep 17 00:00:00 2001 From: Diederik van Lierop Date: Thu, 10 Jul 2014 21:22:59 +0200 Subject: Fix crash when ungrouping a group that has a filter applied to it Fixed bugs: - https://launchpad.net/bugs/1323849 (bzr r13449) --- src/style-internal.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/style-internal.cpp b/src/style-internal.cpp index c686a1807..d0e65a19a 100644 --- a/src/style-internal.cpp +++ b/src/style-internal.cpp @@ -1440,7 +1440,7 @@ SPIFilter::cascade( const SPIBase* const parent ) { void SPIFilter::merge( const SPIBase* const parent ) { if( const SPIFilter* p = dynamic_cast(parent) ) { - // The "correct" thing to due is to combine the filter primitives. + // The "correct" thing to do is to combine the filter primitives. // The next best thing is to keep any filter on this object. If there // is no filter on this object, then use any filter on the parent. if( (!set || inherit) && p->href && p->href->getObject() ) { // is the getObject() needed? @@ -1453,9 +1453,11 @@ SPIFilter::merge( const SPIBase* const parent ) { } } else { // If we don't have an href, create it - if( &style->document ) { // FIXME + if( style->document ) { // FIXME href = new SPFilterReference(style->document); //href->changedSignal().connect(sigc::bind(sigc::ptr_fun(sp_style_filter_ref_changed), style)); + } else if (style->object) { + href = new SPFilterReference(style->object); } } if( href ) { -- cgit v1.2.3 From ac8283706beb41435d25ea5d880fe44d68679803 Mon Sep 17 00:00:00 2001 From: Diederik van Lierop Date: Fri, 11 Jul 2014 20:28:15 +0200 Subject: Fix regression introduced by rev 13446 / 13333 Fixed bugs: - https://launchpad.net/bugs/1256597 - https://launchpad.net/bugs/1340011 (bzr r13450) --- src/seltrans.cpp | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'src') diff --git a/src/seltrans.cpp b/src/seltrans.cpp index d16e02e42..4b1a3a5fa 100644 --- a/src/seltrans.cpp +++ b/src/seltrans.cpp @@ -1321,16 +1321,6 @@ void Inkscape::SelTrans::stretch(SPSelTransHandle const &/*handle*/, Geom::Point void Inkscape::SelTrans::scale(Geom::Point &/*pt*/, guint /*state*/) { - // E.g. scaling a perfectly vertical line in horizontal direction will not work, and will produce an identity affine - // Applying a transformation is useless, so we will not attempt to do so because this might trigger other bugs - // (see https://bugs.launchpad.net/inkscape/+bug/1256597) - // We check for this here and not in transform because identity transformations are perfectly fine for for example - // translations (e.g. a translation of (0,0), which occurs when snapping a point back to its original location) - - if (_absolute_affine.isIdentity()) { - return; - } - transform(_absolute_affine, Geom::Point(0, 0)); // we have already accounted for origin, so pass 0,0 } -- cgit v1.2.3 From 3c71759c0b922e85dbbbffe92ca31cc000d4eced Mon Sep 17 00:00:00 2001 From: Alvin Penner Date: Fri, 11 Jul 2014 18:26:18 -0400 Subject: scale tiled clones to document units (Bug 1288860) Fixed bugs: - https://launchpad.net/bugs/1288860 (bzr r13451) --- src/ui/dialog/clonetiler.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/ui/dialog/clonetiler.cpp b/src/ui/dialog/clonetiler.cpp index fb131d8da..e5f18216c 100644 --- a/src/ui/dialog/clonetiler.cpp +++ b/src/ui/dialog/clonetiler.cpp @@ -2242,6 +2242,8 @@ void CloneTiler::clonetiler_apply(GtkWidget */*widget*/, GtkWidget *dlg) clonetiler_remove (NULL, dlg, false); + double scale_units = Inkscape::Util::Quantity::convert(1, "px", sp_desktop_document(desktop)->getDefaultUnit()); + double shiftx_per_i = 0.01 * prefs->getDoubleLimited(prefs_path + "shiftx_per_i", 0, -10000, 10000); double shifty_per_i = 0.01 * prefs->getDoubleLimited(prefs_path + "shifty_per_i", 0, -10000, 10000); double shiftx_per_j = 0.01 * prefs->getDoubleLimited(prefs_path + "shiftx_per_j", 0, -10000, 10000); @@ -2311,8 +2313,8 @@ void CloneTiler::clonetiler_apply(GtkWidget */*widget*/, GtkWidget *dlg) int jmax = prefs->getInt(prefs_path + "jmax", 2); bool fillrect = prefs->getBool(prefs_path + "fillrect"); - double fillwidth = prefs->getDoubleLimited(prefs_path + "fillwidth", 50, 0, 1e6); - double fillheight = prefs->getDoubleLimited(prefs_path + "fillheight", 50, 0, 1e6); + double fillwidth = scale_units*prefs->getDoubleLimited(prefs_path + "fillwidth", 50, 0, 1e6); + double fillheight = scale_units*prefs->getDoubleLimited(prefs_path + "fillheight", 50, 0, 1e6); bool dotrace = prefs->getBool(prefs_path + "dotrace"); int pick = prefs->getInt(prefs_path + "pick"); @@ -2358,11 +2360,11 @@ void CloneTiler::clonetiler_apply(GtkWidget */*widget*/, GtkWidget *dlg) SPItem::VISUAL_BBOX : SPItem::GEOMETRIC_BBOX ); Geom::OptRect r = item->documentBounds(bbox_type); if (r) { - w = r->dimensions()[Geom::X]; - h = r->dimensions()[Geom::Y]; - x0 = r->min()[Geom::X]; - y0 = r->min()[Geom::Y]; - center = desktop->dt2doc(item->getCenter()); + w = scale_units*r->dimensions()[Geom::X]; + h = scale_units*r->dimensions()[Geom::Y]; + x0 = scale_units*r->min()[Geom::X]; + y0 = scale_units*r->min()[Geom::Y]; + center = scale_units*desktop->dt2doc(item->getCenter()); sp_repr_set_svg_double(obj_repr, "inkscape:tile-cx", center[Geom::X]); sp_repr_set_svg_double(obj_repr, "inkscape:tile-cy", center[Geom::Y]); @@ -2578,7 +2580,7 @@ void CloneTiler::clonetiler_apply(GtkWidget */*widget*/, GtkWidget *dlg) Geom::Point new_center; bool center_set = false; if (obj_repr->attribute("inkscape:transform-center-x") || obj_repr->attribute("inkscape:transform-center-y")) { - new_center = desktop->dt2doc(item->getCenter()) * t; + new_center = scale_units*desktop->dt2doc(item->getCenter()) * t; center_set = true; } -- cgit v1.2.3 From f50d13ff0fa4de4abf81251ec855ca0166db9050 Mon Sep 17 00:00:00 2001 From: Diederik van Lierop Date: Sat, 12 Jul 2014 15:32:27 +0200 Subject: Fix moving of item center: 1) at paste and 2) at changing document units Fixed bugs: - https://launchpad.net/bugs/1247799 (bzr r13452) --- src/selection-chemistry.cpp | 7 +++++-- src/sp-item-group.cpp | 3 ++- src/sp-item.cpp | 5 +++++ src/sp-item.h | 1 + 4 files changed, 13 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp index 868a9d743..f058189d3 100644 --- a/src/selection-chemistry.cpp +++ b/src/selection-chemistry.cpp @@ -1621,10 +1621,13 @@ void sp_selection_apply_affine(Inkscape::Selection *selection, Geom::Affine cons item->doWriteTransform(item->getRepr(), item->transform, NULL, compensate); } - // if we're moving the actual object, not just updating the repr, we can transform the + // if we're transforming the actual object, not just updating the repr, we can transform the // center by the same matrix (only necessary for non-translations) if (set_i2d && item->isCenterSet() && !(affine.isTranslation() || affine.isIdentity())) { - item->setCenter(old_center * affine); + // If there's a viewbox, we might have an affine with a translation component; + // we will only apply the scaling/skewing components, not the translations + // because otherwise the center will move relative to the item + item->setCenter(old_center * affine.withoutTranslation()); item->updateRepr(); } } diff --git a/src/sp-item-group.cpp b/src/sp-item-group.cpp index 2cfe97db8..7af4e3320 100644 --- a/src/sp-item-group.cpp +++ b/src/sp-item-group.cpp @@ -664,7 +664,8 @@ void SPGroup::scaleChildItemsRec(Geom::Scale const &sc, Geom::Point const &p) Geom::Point old_center(0,0); if (item->isCenterSet()) { - old_center = item->getCenter(); + item->scaleCenter(sc.inverse()); // Convert the old relative center position to the new coordinates already now + old_center = item->getCenter(); // because getCenter() will use the bbox midpoint, which is also already in the new coordinates } gchar const *conn_type = NULL; diff --git a/src/sp-item.cpp b/src/sp-item.cpp index b10aae1c6..0cdff6546 100644 --- a/src/sp-item.cpp +++ b/src/sp-item.cpp @@ -271,6 +271,11 @@ Geom::Point SPItem::getCenter() const { } } +void +SPItem::scaleCenter(Geom::Scale const &sc) { + transform_center_x *= sc[Geom::X]; + transform_center_y *= sc[Geom::Y]; +} namespace { diff --git a/src/sp-item.h b/src/sp-item.h index d605c99b9..ce93b1d40 100644 --- a/src/sp-item.h +++ b/src/sp-item.h @@ -159,6 +159,7 @@ public: void unsetCenter(); bool isCenterSet() const; Geom::Point getCenter() const; + void scaleCenter(Geom::Scale const &sc); bool isVisibleAndUnlocked() const; -- cgit v1.2.3 From 70fbc57aa2ae064f92fbc4e6c8950b5c90e4ccac Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Tue, 15 Jul 2014 16:07:09 -0700 Subject: Warnings cleaup. (bzr r13454) --- src/2geom/path.cpp | 2 +- src/display/drawing-text.cpp | 23 ++++++++++++----------- src/extension/internal/emf-print.cpp | 4 ++-- src/extension/internal/wmf-inout.cpp | 1 - src/style-internal.cpp | 10 ++++------ 5 files changed, 19 insertions(+), 21 deletions(-) (limited to 'src') diff --git a/src/2geom/path.cpp b/src/2geom/path.cpp index fc4d72028..3558af3b3 100644 --- a/src/2geom/path.cpp +++ b/src/2geom/path.cpp @@ -110,7 +110,7 @@ Path &Path::operator*=(Translate const &m) { Sequence::iterator it; Point prev; for (it = get_curves().begin() ; it != last ; ++it) { - //*(const_cast(&**it)) *= m; + // *(const_cast(&**it)) *= m; const_cast(it->get())->operator*=(m); if ( it != get_curves().begin() && (*it)->initialPoint() != prev ) { THROW_CONTINUITYERROR(); diff --git a/src/display/drawing-text.cpp b/src/display/drawing-text.cpp index 05a2c3c2a..9f3b447df 100644 --- a/src/display/drawing-text.cpp +++ b/src/display/drawing-text.cpp @@ -150,25 +150,26 @@ unsigned DrawingGlyphs::_updateItem(Geom::IntRect const &/*area*/, UpdateContext return STATE_ALL; } -DrawingItem * -DrawingGlyphs::_pickItem(Geom::Point const &p, double delta, unsigned /*flags*/) +DrawingItem *DrawingGlyphs::_pickItem(Geom::Point const &p, double /*delta*/, unsigned /*flags*/) { DrawingText *ggroup = dynamic_cast(_parent); if (!ggroup) { throw InvalidItemException(); } + DrawingItem *result = NULL; bool invisible = (ggroup->_nrstyle.fill.type == NRStyle::PAINT_NONE) && (ggroup->_nrstyle.stroke.type == NRStyle::PAINT_NONE); - if (!_font || !_bbox || (!_drawing.outline() && invisible) ) { - return NULL; - } - // With text we take a simple approach: pick if the point is in a character bbox - Geom::Rect expanded(_pick_bbox); - // FIXME, why expand by delta? When is the next line needed? - // expanded.expandBy(delta); - if (expanded.contains(p)) return this; - return NULL; + if (_font && _bbox && (_drawing.outline() || !invisible) ) { + // With text we take a simple approach: pick if the point is in a character bbox + Geom::Rect expanded(_pick_bbox); + // FIXME, why expand by delta? When is the next line needed? + // expanded.expandBy(delta); + if (expanded.contains(p)) { + result = this; + } + } + return result; } diff --git a/src/extension/internal/emf-print.cpp b/src/extension/internal/emf-print.cpp index 9c68e40a4..0bdfd45b9 100644 --- a/src/extension/internal/emf-print.cpp +++ b/src/extension/internal/emf-print.cpp @@ -977,8 +977,8 @@ unsigned int PrintEmf::fill( using Geom::X; using Geom::Y; - SPItem *item = SP_ITEM(style->object); - SPClipPath *scp = (item->clip_ref ? item->clip_ref->getObject() : NULL); + //SPItem *item = SP_ITEM(style->object); + //SPClipPath *scp = (item->clip_ref ? item->clip_ref->getObject() : NULL); Geom::Affine tf = m_tr_stack.top(); diff --git a/src/extension/internal/wmf-inout.cpp b/src/extension/internal/wmf-inout.cpp index 85060470b..2b05c6d2c 100644 --- a/src/extension/internal/wmf-inout.cpp +++ b/src/extension/internal/wmf-inout.cpp @@ -63,7 +63,6 @@ namespace Extension { namespace Internal { -static U_RECT16 rc_old; static bool clipset = false; static uint32_t BLTmode=0; diff --git a/src/style-internal.cpp b/src/style-internal.cpp index d0e65a19a..6a56d75c0 100644 --- a/src/style-internal.cpp +++ b/src/style-internal.cpp @@ -1390,9 +1390,8 @@ SPIFilter::read( gchar const *str ) { } } -const Glib::ustring -SPIFilter::write( guint const flags, SPIBase const *const base) const { - +const Glib::ustring SPIFilter::write( guint const flags, SPIBase const *const /*base*/) const +{ // TODO: fix base //SPILength const *const my_base = dynamic_cast(base); if ( (flags & SP_STYLE_FLAG_ALWAYS) || @@ -1923,9 +1922,8 @@ SPIFont::read( gchar const *str ) { } } -const Glib::ustring -SPIFont::write( guint const flags, SPIBase const *const base) const { - +const Glib::ustring SPIFont::write( guint const /*flags*/, SPIBase const *const /*base*/) const +{ // At the moment, do nothing. We could add a preference to write out // 'font' shorthand rather than longhand properties. -- cgit v1.2.3