Add Rect::horizontal_strip() and Rect::vertical_strip() to create infinite slices...
authordooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Fri, 28 Sep 2007 15:19:48 +0000 (15:19 +0000)
committerdooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Fri, 28 Sep 2007 15:19:48 +0000 (15:19 +0000)
git-svn-id: http://svn.voria.com/code@796 1f10aa63-cdf2-0310-b900-c93c546f37ac

synfig-core/trunk/src/synfig/rect.cpp
synfig-core/trunk/src/synfig/rect.h

index ff52e07..ebf6182 100644 (file)
@@ -51,10 +51,20 @@ Rect
 Rect::full_plane()
 {
        const double infinity(HUGE_VAL);
-       return Rect(
-               -infinity,
-               -infinity,
-               infinity,
-               infinity
-       );
+       return Rect(-infinity, -infinity, infinity, infinity);
+}
+
+Rect
+Rect::horizontal_strip(const value_type &y1, const value_type &y2)
+{
+       const double infinity(HUGE_VAL);
+       return Rect(-infinity, y1, infinity, y2);
+}
+
+Rect
+Rect::vertical_strip(const value_type &x1, const value_type &x2)
+{
+       int i, j;
+       const double infinity(HUGE_VAL);
+       return Rect(x1, -infinity, x2, infinity);
 }
index 140c5a1..ed658f2 100644 (file)
@@ -51,6 +51,9 @@ public:
 
        static Rect full_plane();
 
+       static Rect horizontal_strip(const value_type &y1, const value_type &y2);
+       static Rect vertical_strip(const value_type &x1, const value_type &x2);
+
        static Rect zero()
        {
                return Rect(