diff --git a/src/sp-conn-end.cpp b/src/sp-conn-end.cpp
index 52914ee9e0bab7b7f770a40820526ef07c9c53b4..224442eb852370a877a160070d957f0ad09e6b13 100644 (file)
--- a/src/sp-conn-end.cpp
+++ b/src/sp-conn-end.cpp
@@ -46,14 +46,14 @@ static bool try_get_intersect_point_with_item_recursive(Geom::PathVector& conn_p
// if this is a group...
if (SP_IS_GROUP(item)) {
SPGroup* group = SP_GROUP(item);
-
+
// consider all first-order children
- double child_pos = std::numeric_limits<double>::max();
+ double child_pos = 0.0;
for (GSList const* i = sp_item_group_item_list(group); i != NULL; i = i->next) {
SPItem* child_item = SP_ITEM(i->data);
try_get_intersect_point_with_item_recursive(conn_pv, child_item,
item_transform * child_item->transform, child_pos);
- if (intersect_pos > child_pos)
+ if (intersect_pos < child_pos)
intersect_pos = child_pos;
}
return intersect_pos != initial_pos;
for (Geom::Crossings::const_iterator i = cr.begin(); i != cr.end(); i++) {
const Geom::Crossing& cr_pt = *i;
- if ( intersect_pos > cr_pt.ta)
+ if ( intersect_pos < cr_pt.ta)
intersect_pos = cr_pt.ta;
}
}
// The transforms given should be to a common ancestor of both the path and item.
//
static bool try_get_intersect_point_with_item(SPPath* conn, SPItem* item,
- const Geom::Matrix& item_transform, const Geom::Matrix& conn_transform,
+ const Geom::Matrix& item_transform, const Geom::Matrix& conn_transform,
const bool at_start, double& intersect_pos) {
-
+
// Copy the curve and apply transformations up to common ancestor.
SPCurve* conn_curve = conn->curve->copy();
conn_curve->transform(conn_transform);
conn_pv[0] = conn_pv[0].reverse();
}
- // We start with the intersection point at the end of the path
- intersect_pos = conn_pv[0].size();
+ // We start with the intersection point at the beginning of the path
+ intersect_pos = 0.0;
// Find the intersection.
bool result = try_get_intersect_point_with_item_recursive(conn_pv, item, item_transform, intersect_pos);
static void
-sp_conn_get_route_and_redraw(SPPath *const path,
+sp_conn_get_route_and_redraw(SPPath *const path,
const bool updatePathRepr = true)
{
// Get the new route around obstacles.
if (!rerouted) {
return;
}
-
+
SPItem *h2attItem[2];
path->connEndPair.getAttachedItems(h2attItem);
SPObject const *const ancestor = get_nearest_common_ancestor(path_item, h2attItem);
Geom::Matrix const path2anc(i2anc_affine(path_item, ancestor));
- // Set sensible values incase there the connector ends are not
+ // Set sensible values incase there the connector ends are not
// attached to any shapes.
Geom::PathVector conn_pv = path->curve->get_pathvector();
double endPos[2] = { 0, conn_pv[0].size() };
}
void
-SPConnEnd::setAttacherHref(gchar const *value, SPPath* path)
+SPConnEnd::setAttacherHref(gchar const *value, SPPath* /*path*/)
{
if ( value && href && ( strcmp(value, href) == 0 ) ) {
/* No change, do nothing. */
}
}
// Check to see if the connection point changed and update it.
- //
+ //
if ( !value_strarray[1] )
{
validRef = false;
}
}
-
+
if ( changed )
{
// We still have to verify that the reference to the
// connection point is a valid one.
-
+
// Get the item the connector is attached to
SPItem* item = ref.getObject();
if ( item && !item->avoidRef->isValidConnPointId( type, id ) )
// Update the connector
if (path->connEndPair.isAutoRoutingConn()) {
path->connEndPair.tellLibavoidNewEndpoints();
- }*/
+ }
+*/
}
if ( !validRef )