summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 585fbff)
raw | patch | inline | side by side (parent: 585fbff)
author | buliabyak <buliabyak@users.sourceforge.net> | |
Tue, 6 May 2008 05:33:58 +0000 (05:33 +0000) | ||
committer | buliabyak <buliabyak@users.sourceforge.net> | |
Tue, 6 May 2008 05:33:58 +0000 (05:33 +0000) |
src/ui/dialog/align-and-distribute.cpp | patch | blob | history | |
src/ui/dialog/align-and-distribute.h | patch | blob | history |
index 9b16320f365140f172a2b59f70f9e9192ca66f8a..68c083c6f5341da6627ef7f2aeb7b41231ea4881 100644 (file)
{0., 0., 1., 0., 0., 0., 0., 1.}
};
-struct BBoxSort
-{
- SPItem *item;
- float anchor;
- NR::Rect bbox;
- BBoxSort(SPItem *pItem, NR::Rect bounds, NR::Dim2 orientation, double kBegin, double kEnd) :
+BBoxSort::BBoxSort(SPItem *pItem, NR::Rect bounds, NR::Dim2 orientation, double kBegin, double kEnd) :
item(pItem),
bbox (bounds)
- {
+{
anchor = kBegin * bbox.min()[orientation] + kEnd * bbox.max()[orientation];
- }
- BBoxSort(const BBoxSort &rhs):
+}
+BBoxSort::BBoxSort(const BBoxSort &rhs) :
//NOTE : this copy ctor is called O(sort) when sorting the vector
//this is bad. The vector should be a vector of pointers.
//But I'll wait the bohem GC before doing that
- item(rhs.item), anchor(rhs.anchor), bbox(rhs.bbox) {
- }
-};
+ item(rhs.item), anchor(rhs.anchor), bbox(rhs.bbox)
+{
+}
+
bool operator< (const BBoxSort &a, const BBoxSort &b)
{
return (a.anchor < b.anchor);
index a54ac781ef8752cff85c91a4b5377e5faa3c469d..d6cbd377f30be593b46cd2ffacb2204e2e33c9ae 100644 (file)
AlignAndDistribute& operator=(AlignAndDistribute const &d);
};
+
+struct BBoxSort
+{
+ SPItem *item;
+ float anchor;
+ NR::Rect bbox;
+ BBoxSort(SPItem *pItem, NR::Rect bounds, NR::Dim2 orientation, double kBegin, double kEnd);
+ BBoxSort(const BBoxSort &rhs);
+};
+bool operator< (const BBoxSort &a, const BBoxSort &b);
+
} // namespace Dialog
} // namespace UI
} // namespace Inkscape