From d35785acb9567468dc2a520970f3f2f9313d0fca Mon Sep 17 00:00:00 2001 From: dooglus Date: Fri, 28 Sep 2007 15:19:48 +0000 Subject: [PATCH] Add Rect::horizontal_strip() and Rect::vertical_strip() to create infinite slices of the plane. git-svn-id: http://svn.voria.com/code@796 1f10aa63-cdf2-0310-b900-c93c546f37ac --- synfig-core/trunk/src/synfig/rect.cpp | 22 ++++++++++++++++------ synfig-core/trunk/src/synfig/rect.h | 3 +++ 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/synfig-core/trunk/src/synfig/rect.cpp b/synfig-core/trunk/src/synfig/rect.cpp index ff52e07..ebf6182 100644 --- a/synfig-core/trunk/src/synfig/rect.cpp +++ b/synfig-core/trunk/src/synfig/rect.cpp @@ -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); } diff --git a/synfig-core/trunk/src/synfig/rect.h b/synfig-core/trunk/src/synfig/rect.h index 140c5a1..ed658f2 100644 --- a/synfig-core/trunk/src/synfig/rect.h +++ b/synfig-core/trunk/src/synfig/rect.h @@ -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( -- 2.7.4