From ec1a3157c1851dcb481f402ec25aa38fa9e7c51c Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Sat, 18 Jan 2014 23:02:05 -0500 Subject: Better pixelization of dashed lines for screen rendering. Now the dashed lines are evenly placed on screen. For now, horizontal lines only. I'll work on vertical lines later. Change-Id: I474e9c8214e5f079ea2cfca12b35381d8fcf2ae1 --- svtools/source/control/ctrlbox.cxx | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'svtools') diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx index b77b737037ea..47012cd7a79c 100644 --- a/svtools/source/control/ctrlbox.cxx +++ b/svtools/source/control/ctrlbox.cxx @@ -586,6 +586,9 @@ void lclDrawPolygon( OutputDevice& rDev, const basegfx::B2DPolygon& rPolygon, lo namespace svtools { +/** + * Dashing array must start with a line width and end with a blank width. + */ std::vector GetDashing( sal_uInt16 nDashing ) { std::vector aPattern; @@ -625,6 +628,13 @@ public: } +std::vector GetLineDashing( sal_uInt16 nDashing, double fScale ) +{ + std::vector aPattern = GetDashing(nDashing); + std::for_each(aPattern.begin(), aPattern.end(), ApplyScale(fScale)); + return aPattern; +} + basegfx::B2DPolyPolygon ApplyLineDashing( const basegfx::B2DPolygon& rPolygon, sal_uInt16 nDashing, double fScale ) { std::vector aPattern = GetDashing(nDashing); -- cgit