Code

Fix snapping to midpoints of closing segments
[inkscape.git] / src / connection-points.cpp
1 #include "connection-points.h"
4 bool ConnectionPoint::operator!=(ConnectionPoint& cp)
5 {
6     return (id!=cp.id || type!=cp.type || dir!=cp.dir || pos!=cp.pos);
7 }
9 bool ConnectionPoint::operator==(ConnectionPoint& cp)
10 {
11     return (id==cp.id && type==cp.type && dir==cp.dir && pos==cp.pos);
12 }
15 namespace Inkscape{
17 SVGIStringStream&
18 operator>>(SVGIStringStream& istr, ConnectionPoint& cp)
19 {
20     istr>>cp.id>>cp.dir>>cp.pos[Geom::X]>>cp.pos[Geom::Y];
22     return istr;
23 }
25 SVGOStringStream&
26 operator<<(SVGOStringStream& ostr, const ConnectionPoint& cp)
27 {
28     ostr<<cp.id<<' '<<cp.dir<<' ';
29     ::operator<<( ostr, cp.pos[Geom::X] );
30     ostr<<' ';
31     ::operator<<( ostr, cp.pos[Geom::Y] );
33     return ostr;
34 }
37 }