summaryrefslogtreecommitdiff
path: root/drawinglayer
diff options
context:
space:
mode:
authorThorsten Behrens <tbehrens@novell.com>2010-10-26 23:04:44 +0200
committerThorsten Behrens <tbehrens@novell.com>2010-10-26 23:04:44 +0200
commitf64ef72743e55389e446e0d4bc6febd475011023 (patch)
tree13dacfb392466476bbe647c74520fa1e4eb860af /drawinglayer
parent5e1626f2cf40d4b52128d4464e838b8df0be55a7 (diff)
Better shading algo for customshapes, better gradients
Some custom shapes can have shaded parts, like for example 3d can, the bevelled buttons etc. Those shaded colors are calculated internally, and have been way off at times. Now using HSV color space & the originally documented luminance modifications in steps of 10 percent. Compared to MSO, still no 100 percent match, but that seems due to gamma correction there. Additionally, starting with MSO12, gradients on those shaded surfaces look much better; adapted code to display gradients equally nice. Note that most of this patch also applies to ooxml import; note as well that customshapes from *all* kind of input files (including ODF docs) now look different than before; no real way of changing this in a backward-compatible way, since behaviour of custom shapes is mandated (mostly) by internal tables, and not stored in a file. Applies patches/dev300/ppt-customshape-shading-fix (much of it was accepted at OOo already, via i#102797) Applies patches/dev300/ppt-customshape-shading-fix.diff: fixed prob with line arrows - the extra-added single point polygons lead to extra arrows randomly around the custom shape. i#105654
Diffstat (limited to 'drawinglayer')
-rw-r--r--drawinglayer/source/primitive2d/polygonprimitive2d.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/drawinglayer/source/primitive2d/polygonprimitive2d.cxx b/drawinglayer/source/primitive2d/polygonprimitive2d.cxx
index ee73d74b5c24..6a656445db40 100644
--- a/drawinglayer/source/primitive2d/polygonprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/polygonprimitive2d.cxx
@@ -509,10 +509,11 @@ namespace drawinglayer
{
// copy local polygon, it may be changed
basegfx::B2DPolygon aLocalPolygon(getB2DPolygon());
+ aLocalPolygon.removeDoublePoints();
basegfx::B2DPolyPolygon aArrowA;
basegfx::B2DPolyPolygon aArrowB;
- if(!aLocalPolygon.isClosed())
+ if(!aLocalPolygon.isClosed() && aLocalPolygon.count() > 1)
{
// apply arrows
const double fPolyLength(basegfx::tools::getLength(aLocalPolygon));