From f64ef72743e55389e446e0d4bc6febd475011023 Mon Sep 17 00:00:00 2001 From: Thorsten Behrens Date: Tue, 26 Oct 2010 23:04:44 +0200 Subject: 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 --- svx/source/customshapes/EnhancedCustomShapeFontWork.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'svx/source/customshapes/EnhancedCustomShapeFontWork.cxx') diff --git a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx index 78d0dda8e57a..8118264ccbc9 100644 --- a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx +++ b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx @@ -633,7 +633,7 @@ void InsertMissingOutlinePoints( const Polygon& /*rOutlinePoly*/, const std::vec void GetPoint( const Polygon& rPoly, const std::vector< double >& rDistances, const double& fX, double& fx1, double& fy1 ) { fy1 = fx1 = 0.0; - if ( rPoly.GetSize() ) + if ( rPoly.GetSize() > 1 ) { std::vector< double >::const_iterator aIter = std::lower_bound( rDistances.begin(), rDistances.end(), fX ); sal_uInt16 nIdx = sal::static_int_cast( std::distance( rDistances.begin(), aIter ) ); -- cgit