From 59db4be207ca6651a29366d326436ba2f40bb6ab Mon Sep 17 00:00:00 2001 From: Armin Le Grand Date: Thu, 4 Oct 2012 15:27:22 +0000 Subject: Related: #i120604# corrected 3d gradients adapted basegfx to be smarter in some areas (cherry picked from commit 888e64505474808166c29ada24178cc3e58d6c18) Conflicts: basegfx/inc/basegfx/pixel/bpixel.hxx basegfx/inc/basegfx/point/b2dhompoint.hxx basegfx/inc/basegfx/point/b3dhompoint.hxx basegfx/inc/basegfx/raster/rasterconvert3d.hxx basegfx/inc/basegfx/tuple/b2dtuple.hxx basegfx/inc/basegfx/tuple/b2i64tuple.hxx basegfx/inc/basegfx/tuple/b2ituple.hxx basegfx/inc/basegfx/tuple/b3dtuple.hxx basegfx/inc/basegfx/tuple/b3i64tuple.hxx basegfx/inc/basegfx/tuple/b3ituple.hxx basegfx/source/point/b2dhompoint.cxx basegfx/source/tuple/b2ituple.cxx Change-Id: Id92864093dd40d34bd20b130cc3b405a7b8f9d91 --- basegfx/source/tools/gradienttools.cxx | 24 +++++++------ basegfx/source/tuple/b2ituple.cxx | 64 ---------------------------------- 2 files changed, 13 insertions(+), 75 deletions(-) (limited to 'basegfx') diff --git a/basegfx/source/tools/gradienttools.cxx b/basegfx/source/tools/gradienttools.cxx index 83b6e21e0f32..11bd62f61843 100644 --- a/basegfx/source/tools/gradienttools.cxx +++ b/basegfx/source/tools/gradienttools.cxx @@ -355,19 +355,20 @@ namespace basegfx { const B2DPoint aCoor(rGradInfo.getBackTextureTransform() * rUV); - if(aCoor.getX() < 0.0 || aCoor.getX() > 1.0) - { - return 0.0; - } + // Ignore Y, this is not needed at all for Y-Oriented gradients + // if(aCoor.getX() < 0.0 || aCoor.getX() > 1.0) + // { + // return 0.0; + // } if(aCoor.getY() <= 0.0) { - return 0.0; + return 0.0; // start value for inside } if(aCoor.getY() >= 1.0) { - return 1.0; + return 1.0; // end value for outside } const sal_uInt32 nSteps(rGradInfo.getSteps()); @@ -384,16 +385,17 @@ namespace basegfx { const B2DPoint aCoor(rGradInfo.getBackTextureTransform() * rUV); - if(aCoor.getX() < 0.0 || aCoor.getX() > 1.0) - { - return 0.0; - } + // Ignore Y, this is not needed at all for Y-Oriented gradients + //if(aCoor.getX() < 0.0 || aCoor.getX() > 1.0) + //{ + // return 0.0; + //} const double fAbsY(fabs(aCoor.getY())); if(fAbsY >= 1.0) { - return 0.0; + return 1.0; // use end value when outside in Y } const sal_uInt32 nSteps(rGradInfo.getSteps()); diff --git a/basegfx/source/tuple/b2ituple.cxx b/basegfx/source/tuple/b2ituple.cxx index 786699b05d23..f70ac73ddf14 100644 --- a/basegfx/source/tuple/b2ituple.cxx +++ b/basegfx/source/tuple/b2ituple.cxx @@ -23,68 +23,4 @@ namespace { struct EmptyTuple : public rtl::Static {}; } -namespace basegfx -{ - // external operators - ////////////////////////////////////////////////////////////////////////// - - B2ITuple operator+(const B2ITuple& rTupA, const B2ITuple& rTupB) - { - B2ITuple aSum(rTupA); - aSum += rTupB; - return aSum; - } - - B2ITuple operator-(const B2ITuple& rTupA, const B2ITuple& rTupB) - { - B2ITuple aSub(rTupA); - aSub -= rTupB; - return aSub; - } - - B2ITuple operator/(const B2ITuple& rTupA, const B2ITuple& rTupB) - { - B2ITuple aDiv(rTupA); - aDiv /= rTupB; - return aDiv; - } - - B2ITuple operator*(const B2ITuple& rTupA, const B2ITuple& rTupB) - { - B2ITuple aMul(rTupA); - aMul *= rTupB; - return aMul; - } - - B2ITuple operator*(const B2ITuple& rTup, sal_Int32 t) - { - B2ITuple aNew(rTup); - aNew *= t; - return aNew; - } - - B2ITuple operator*(sal_Int32 t, const B2ITuple& rTup) - { - B2ITuple aNew(rTup); - aNew *= t; - return aNew; - } - - B2ITuple operator/(const B2ITuple& rTup, sal_Int32 t) - { - B2ITuple aNew(rTup); - aNew /= t; - return aNew; - } - - B2ITuple operator/(sal_Int32 t, const B2ITuple& rTup) - { - B2ITuple aNew(t, t); - B2ITuple aTmp(rTup); - aNew /= aTmp; - return aNew; - } - -} // end of namespace basegfx - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit