index 33225f467c3055dad6a5f33cff66bc0de745443a..5bce1a4f80d7a4378848e0e0c66229b73c239c08 100644 (file)
--- a/src/sp-conn-end-pair.cpp
+++ b/src/sp-conn-end-pair.cpp
* Authors:
* Peter Moulder <pmoulder@mail.csse.monash.edu.au>
* Michael Wybrow <mjwybrow@users.sourceforge.net>
+ * Abhishek Sharma
*
* * Copyright (C) 2004-2005 Monash University
*
this->_connEnd[handle_ix]->ref.detach();
}
- // If the document is being destroyed then the router instance
+ // If the document is being destroyed then the router instance
// and the ConnRefs will have been destroyed with it.
const bool routerInstanceExists = (_path->document->router != NULL);
void
sp_conn_end_pair_build(SPObject *object)
{
- sp_object_read_attr(object, "inkscape:connector-type");
- sp_object_read_attr(object, "inkscape:connection-start");
- sp_object_read_attr(object, "inkscape:connection-start-point");
- sp_object_read_attr(object, "inkscape:connection-end");
- sp_object_read_attr(object, "inkscape:connection-end-point");
- sp_object_read_attr(object, "inkscape:connector-curvature");
+ object->readAttr( "inkscape:connector-type" );
+ object->readAttr( "inkscape:connection-start" );
+ object->readAttr( "inkscape:connection-start-point" );
+ object->readAttr( "inkscape:connection-end" );
+ object->readAttr( "inkscape:connection-end-point" );
+ object->readAttr( "inkscape:connector-curvature" );
}
case SP_ATTR_CONNECTOR_TYPE:
if (value && (strcmp(value, "polyline") == 0 || strcmp(value, "orthogonal") == 0)) {
int newconnType = strcmp(value, "polyline") ? SP_CONNECTOR_ORTHOGONAL : SP_CONNECTOR_POLYLINE;
-
+
if (!_connRef)
{
_connType = newconnType;
Avoid::Router *router = _path->document->router;
- GQuark itemID = g_quark_from_string(SP_OBJECT(_path)->id);
+ GQuark itemID = g_quark_from_string(_path->getId());
_connRef = new Avoid::ConnRef(router, itemID);
switch (newconnType)
{
SPCurve *curve = _path->original_curve ? _path->original_curve : _path->curve;
SPItem *h2attItem[2];
getAttachedItems(h2attItem);
+ Geom::Matrix i2d = SP_ITEM(_path)->i2doc_affine();
for (unsigned h = 0; h < 2; ++h) {
if ( h2attItem[h] ) {
else
{
if (h == 0) {
- endPts[h] = *(curve->first_point());
+ endPts[h] = *(curve->first_point())*i2d;
}
else {
- endPts[h] = *(curve->last_point());
+ endPts[h] = *(curve->last_point())*i2d;
}
}
}
@@ -339,7 +341,7 @@ void recreateCurve(SPCurve *curve, Avoid::ConnRef *connRef, const gdouble curvat
if (!straight)
route = route.curvedPolyline(curvature);
connRef->calcRouteDist();
-
+
curve->reset();
curve->moveto( Geom::Point(route.ps[0].x, route.ps[0].y) );
@@ -359,7 +361,7 @@ void recreateCurve(SPCurve *curve, Avoid::ConnRef *connRef, const gdouble curvat
break;
case 'C':
g_assert( i+2<pn );
- curve->curveto( p, Geom::Point(route.ps[i+1].x, route.ps[i+1].y),
+ curve->curveto( p, Geom::Point(route.ps[i+1].x, route.ps[i+1].y),
Geom::Point(route.ps[i+2].x, route.ps[i+2].y) );
i+=2;
break;
SPCurve *curve = _path->original_curve ?_path->original_curve : _path->curve;
recreateCurve( curve, _connRef, _connCurvature );
-
- Geom::Matrix doc2item = sp_item_i2doc_affine(SP_ITEM(_path)).inverse();
- curve->transform(doc2item);
-
+
+ Geom::Matrix doc2item = SP_ITEM(_path)->i2doc_affine().inverse();
+ curve->transform(doc2item);
+
return true;
}