summaryrefslogtreecommitdiff
path: root/basegfx/inc
diff options
context:
space:
mode:
authorThorsten Behrens <tbehrens@suse.com>2011-11-02 16:32:00 +0100
committerThorsten Behrens <tbehrens@suse.com>2011-11-02 23:58:28 +0100
commit3c8f2388769a439a871c90550832a6aeb03227dc (patch)
treee2f8bb6b2d062ef19c7462e86a92bd1c0e5bc4c9 /basegfx/inc
parent3c1b4b6ef70b049bc5242149e727dd5d94111d86 (diff)
Fix BXYBox behaviour and unit test
Made the distinction more clear, added appropriate tests to nail behaviour.
Diffstat (limited to 'basegfx/inc')
-rw-r--r--basegfx/inc/basegfx/range/b1irange.hxx5
-rw-r--r--basegfx/inc/basegfx/range/basicbox.hxx11
-rw-r--r--basegfx/inc/basegfx/range/basicrange.hxx13
3 files changed, 10 insertions, 19 deletions
diff --git a/basegfx/inc/basegfx/range/b1irange.hxx b/basegfx/inc/basegfx/range/b1irange.hxx
index 90e5ba23d01c..81e19ef29904 100644
--- a/basegfx/inc/basegfx/range/b1irange.hxx
+++ b/basegfx/inc/basegfx/range/b1irange.hxx
@@ -121,6 +121,11 @@ namespace basegfx
return maRange.overlaps(rRange.maRange);
}
+ bool overlapsMore(const B1IRange& rRange) const
+ {
+ return maRange.overlapsMore(rRange.maRange);
+ }
+
void expand(sal_Int32 nValue)
{
maRange.expand(nValue);
diff --git a/basegfx/inc/basegfx/range/basicbox.hxx b/basegfx/inc/basegfx/range/basicbox.hxx
index 6c7606748420..a6eae3a628f2 100644
--- a/basegfx/inc/basegfx/range/basicbox.hxx
+++ b/basegfx/inc/basegfx/range/basicbox.hxx
@@ -35,12 +35,11 @@
namespace basegfx
{
- /** Specialization of BasicRange, handling the inside predicates
+ /** Explicitely different from BasicRange, handling the inside predicates
differently.
- This template considers the rightmost and bottommost border as
- <em>outside</em> of the range, in contrast to BasicRange,
- which considers them inside.
+ This is modelled after how polygon fill algorithms set pixel -
+ typically excluding rightmost and bottommost ones.
*/
class BASEGFX_DLLPUBLIC BasicBox : public BasicRange< sal_Int32, Int32Traits >
{
@@ -56,9 +55,9 @@ namespace basegfx
{
}
- BasicBox(const BasicBox& rBox) :
- Base( rBox )
+ bool isEmpty() const
{
+ return mnMinimum >= mnMaximum;
}
double getCenter() const
diff --git a/basegfx/inc/basegfx/range/basicrange.hxx b/basegfx/inc/basegfx/range/basicrange.hxx
index 8711f95b754c..daf552f56daf 100644
--- a/basegfx/inc/basegfx/range/basicrange.hxx
+++ b/basegfx/inc/basegfx/range/basicrange.hxx
@@ -58,12 +58,6 @@ namespace basegfx
{
}
- BasicRange(const BasicRange& rRange) :
- mnMinimum(rRange.mnMinimum),
- mnMaximum(rRange.mnMaximum)
- {
- }
-
void reset()
{
mnMinimum = Traits::maxVal();
@@ -158,13 +152,6 @@ namespace basegfx
return (mnMinimum != rRange.mnMinimum || mnMaximum != rRange.mnMaximum);
}
- BasicRange& operator=(const BasicRange& rRange)
- {
- mnMinimum = rRange.mnMinimum;
- mnMaximum = rRange.mnMaximum;
- return *this;
- }
-
bool equal(const BasicRange& rRange) const
{
return (