From 1d854ff519b9c0867bfa4ecaf2f6329ca256f06a Mon Sep 17 00:00:00 2001 From: "Liam P. White" Date: Sun, 2 Mar 2014 10:29:06 -0500 Subject: Experimental merge of Ponyscape features into trunk (will not compile) (bzr r13090.1.1) --- src/sp-item.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/sp-item.cpp') diff --git a/src/sp-item.cpp b/src/sp-item.cpp index 5e126f486..aec749929 100644 --- a/src/sp-item.cpp +++ b/src/sp-item.cpp @@ -183,6 +183,26 @@ bool SPItem::isHidden(unsigned display_key) const { return true; } +bool SPItem::isHighlightSet() const { + return _highlightColor != NULL; +} + +guint32 SPItem::highlight_color() const { + if (_highlightColor) + { + return atoi(_highlightColor) | 0x000000ff; + } + else if (parent && parent != this && SP_IS_ITEM(parent)) + { + return SP_ITEM(parent)->highlight_color(); + } + else + { + static Inkscape::Preferences *prefs = Inkscape::Preferences::get(); + return prefs->getInt("/tools/nodes/highlight_color", 0xff0000ff) | 0x000000ff; + } +} + void SPItem::setEvaluated(bool evaluated) { _is_evaluated = evaluated; _evaluated_status = StatusSet; -- cgit v1.2.3 From 1f7732ba927a31166d834a206bdfc7d20128d483 Mon Sep 17 00:00:00 2001 From: "Liam P. White" Date: Sun, 2 Mar 2014 14:15:38 -0500 Subject: Attempt at merging certaing features of Ponyscape to trunk (will not link) (bzr r13090.1.5) --- src/sp-item.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/sp-item.cpp') diff --git a/src/sp-item.cpp b/src/sp-item.cpp index aec749929..279606481 100644 --- a/src/sp-item.cpp +++ b/src/sp-item.cpp @@ -416,6 +416,7 @@ void SPItem::build(SPDocument *document, Inkscape::XML::Node *repr) { object->readAttr( "inkscape:transform-center-y" ); object->readAttr( "inkscape:connector-avoid" ); object->readAttr( "inkscape:connection-points" ); + object->readAttr( "inkscape:highlight-color" ); SPObject::build(document, repr); } -- cgit v1.2.3 From 93e2eef0d931bc2250b0328ddc24dac76c7c3e03 Mon Sep 17 00:00:00 2001 From: "Liam P. White" Date: Sun, 2 Mar 2014 18:18:32 -0500 Subject: Modified Objects dialogue to stop crashing on change of highlight color (bzr r13090.1.10) --- src/sp-item.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/sp-item.cpp') diff --git a/src/sp-item.cpp b/src/sp-item.cpp index 279606481..79d8cc37d 100644 --- a/src/sp-item.cpp +++ b/src/sp-item.cpp @@ -99,6 +99,8 @@ SPItem::SPItem() : SPObject() { sensitive = TRUE; bbox_valid = FALSE; + _highlightColor = NULL; + transform_center_x = 0; transform_center_y = 0; -- cgit v1.2.3 From 4eed716131afa00f3590b7d60600ef0c476c78e3 Mon Sep 17 00:00:00 2001 From: "Liam P. White" Date: Sun, 2 Mar 2014 20:24:50 -0500 Subject: Fixed path color when changed by Objects Dialog (bzr r13090.1.11) --- src/sp-item.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/sp-item.cpp') diff --git a/src/sp-item.cpp b/src/sp-item.cpp index 79d8cc37d..ff3e3a31c 100644 --- a/src/sp-item.cpp +++ b/src/sp-item.cpp @@ -493,11 +493,23 @@ void SPItem::set(unsigned int key, gchar const* value) { break; } case SP_ATTR_SODIPODI_INSENSITIVE: + { item->sensitive = !value; for (SPItemView *v = item->display; v != NULL; v = v->next) { v->arenaitem->setSensitive(item->sensitive); } break; + } + case SP_ATTR_INKSCAPE_HIGHLIGHT_COLOR: + { + g_free(item->_highlightColor); + if (value) { + item->_highlightColor = g_strdup(value); + } else { + item->_highlightColor = NULL; + } + break; + } case SP_ATTR_CONNECTOR_AVOID: item->avoidRef->setAvoid(value); break; @@ -706,6 +718,11 @@ Inkscape::XML::Node* SPItem::write(Inkscape::XML::Document *xml_doc, Inkscape::X g_free ((void *) uri); } } + if (item->_highlightColor){ + repr->setAttribute("inkscape:highlight-color", item->_highlightColor); + } else { + repr->setAttribute("inkscape:highlight-color", NULL); + } SPObject::write(xml_doc, repr, flags); -- cgit v1.2.3 From 8b31d0e28a6cf0f916f5267c54fed76c712c48a3 Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Fri, 1 Aug 2014 10:13:43 +0200 Subject: Rename 'blend-mode' property to 'mix-blend-mode' per CSS spec. (bzr r13341.1.113) --- src/sp-item.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/sp-item.cpp') diff --git a/src/sp-item.cpp b/src/sp-item.cpp index a3f1a5d64..6c2ada9d7 100644 --- a/src/sp-item.cpp +++ b/src/sp-item.cpp @@ -602,7 +602,7 @@ void SPItem::update(SPCtx* /*ctx*/, guint flags) { v->arenaitem->setOpacity(SP_SCALE24_TO_FLOAT(object->style->opacity.value)); v->arenaitem->setAntialiasing(object->style->shape_rendering.computed != SP_CSS_SHAPE_RENDERING_CRISPEDGES); v->arenaitem->setIsolation( object->style->isolation.value ); - v->arenaitem->setBlendMode( object->style->blend_mode.value ); + v->arenaitem->setBlendMode( object->style->mix_blend_mode.value ); v->arenaitem->setVisible(!item->isHidden()); } } @@ -1028,7 +1028,7 @@ Inkscape::DrawingItem *SPItem::invoke_show(Inkscape::Drawing &drawing, unsigned ai->setTransform(transform); ai->setOpacity(SP_SCALE24_TO_FLOAT(style->opacity.value)); ai->setIsolation( style->isolation.value ); - ai->setBlendMode( style->blend_mode.value ); + ai->setBlendMode( style->mix_blend_mode.value ); //ai->setCompositeOperator( style->composite_op.value ); ai->setVisible(!isHidden()); ai->setSensitive(sensitive); -- cgit v1.2.3 From 1f2d8bc4ce99e970cead4ca96c1859c383a9c043 Mon Sep 17 00:00:00 2001 From: "Liam P. White" Date: Sun, 31 Aug 2014 14:17:26 -0400 Subject: Header cleanup: stop using Glib types where they aren't truly needed. Eases GThread deprecation errors. (bzr r13341.1.190) --- src/sp-item.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/sp-item.cpp') diff --git a/src/sp-item.cpp b/src/sp-item.cpp index 428f9555e..c79508199 100644 --- a/src/sp-item.cpp +++ b/src/sp-item.cpp @@ -360,7 +360,7 @@ void SPItem::lowerToBottom() { * \param target - the SPItem to move into or after * \param intoafter - move to after the target (false), move inside (sublayer) of the target (true) */ -void SPItem::moveTo(SPItem *target, gboolean intoafter) { +void SPItem::moveTo(SPItem *target, bool intoafter) { Inkscape::XML::Node *target_ref = ( target ? target->getRepr() : NULL ); Inkscape::XML::Node *our_ref = getRepr(); -- cgit v1.2.3 From 0d0958e3b2aff0ed5f3ad7a98b4035213475c7f1 Mon Sep 17 00:00:00 2001 From: "Liam P. White" Date: Sun, 7 Sep 2014 13:02:01 -0400 Subject: Update to experimental r13543 (bzr r13090.1.108) --- src/sp-item.cpp | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'src/sp-item.cpp') diff --git a/src/sp-item.cpp b/src/sp-item.cpp index 67a0eac13..c3cbe531f 100644 --- a/src/sp-item.cpp +++ b/src/sp-item.cpp @@ -256,9 +256,13 @@ void SPItem::setCenter(Geom::Point const &object_centre) { document->ensureUpToDate(); // Copied from DocumentProperties::onDocUnitChange() - gdouble viewscale_w = this->document->getWidth().value("px") / this->document->getRoot()->viewBox.width(); - gdouble viewscale_h = this->document->getHeight().value("px")/ this->document->getRoot()->viewBox.height(); - gdouble viewscale = std::min(viewscale_h, viewscale_w); + gdouble viewscale = 1.0; + Geom::Rect vb = this->document->getRoot()->viewBox; + if ( !vb.hasZeroArea() ) { + gdouble viewscale_w = this->document->getWidth().value("px") / vb.width(); + gdouble viewscale_h = this->document->getHeight().value("px")/ vb.height(); + viewscale = std::min(viewscale_h, viewscale_w); + } // FIXME this is seriously wrong Geom::OptRect bbox = desktopGeometricBounds(); @@ -289,9 +293,13 @@ Geom::Point SPItem::getCenter() const { document->ensureUpToDate(); // Copied from DocumentProperties::onDocUnitChange() - gdouble viewscale_w = this->document->getWidth().value("px") / this->document->getRoot()->viewBox.width(); - gdouble viewscale_h = this->document->getHeight().value("px")/ this->document->getRoot()->viewBox.height(); - gdouble viewscale = std::min(viewscale_h, viewscale_w); + gdouble viewscale = 1.0; + Geom::Rect vb = this->document->getRoot()->viewBox; + if ( !vb.hasZeroArea() ) { + gdouble viewscale_w = this->document->getWidth().value("px") / vb.width(); + gdouble viewscale_h = this->document->getHeight().value("px")/ vb.height(); + viewscale = std::min(viewscale_h, viewscale_w); + } // FIXME this is seriously wrong Geom::OptRect bbox = desktopGeometricBounds(); -- cgit v1.2.3 From 3f649ca279f98542e8147e9bd5ab67691c6e21a0 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 24 Sep 2014 21:22:34 +0200 Subject: Fix bug in object dialog, in highlight color couldent select opacity, now fixed (bzr r13341.1.224) --- src/sp-item.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/sp-item.cpp') diff --git a/src/sp-item.cpp b/src/sp-item.cpp index c3cbe531f..10dc1a32c 100644 --- a/src/sp-item.cpp +++ b/src/sp-item.cpp @@ -188,7 +188,7 @@ bool SPItem::isHighlightSet() const { guint32 SPItem::highlight_color() const { if (_highlightColor) { - return atoi(_highlightColor) | 0x000000ff; + return atoi(_highlightColor) | 0x00000000; } else if (parent && parent != this && SP_IS_ITEM(parent)) { @@ -197,7 +197,7 @@ guint32 SPItem::highlight_color() const { else { static Inkscape::Preferences *prefs = Inkscape::Preferences::get(); - return prefs->getInt("/tools/nodes/highlight_color", 0xff0000ff) | 0x000000ff; + return prefs->getInt("/tools/nodes/highlight_color", 0xff0000ff) | 0x00000000; } } -- cgit v1.2.3