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
commit0e059638d80793931dc5c6fb9fdf9bb4466abadf (patch)
tree1c8fd2e038a97a74cd0b03a95dfaa5ac80c8f13c /drawinglayer
parent045822069090d8a37aab656e2875f4d9437e133f (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 c22621d35e..79a280f00d 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));