summaryrefslogtreecommitdiff
path: root/include/svx/xdash.hxx
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2021-04-27 11:44:48 +0200
committerLuboš Luňák <l.lunak@collabora.com>2021-04-29 16:05:53 +0200
commitb71d9a6d15cfb8a50afdea5ac064f40d84c561f8 (patch)
tree3a9bd3205754d28f411257e0207295a781451d6d /include/svx/xdash.hxx
parent5d4e450a7d64d3dc1caf34544dbfa35f4641d5c3 (diff)
do not apply line dashing in drawinglayer (tdf#136957)
basegfx::utils::applyLineDashing() is not as good as the actual VCL backend dashing, and there are some rounding errors because of all the canvas transformation matrices or whatever, which leads to the drawing problem. So use LineInfo to carry the dashing information. As a part of this change, also make LineInfo use doubles instead of ints. The use of transformation matrices means that the values may be fractional and less than one. Change-Id: Ia5ac7d266cab344b7137052c81fbd96c1ce28003 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114710 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'include/svx/xdash.hxx')
-rw-r--r--include/svx/xdash.hxx22
1 files changed, 11 insertions, 11 deletions
diff --git a/include/svx/xdash.hxx b/include/svx/xdash.hxx
index e1fca6b67f14..e789830e2736 100644
--- a/include/svx/xdash.hxx
+++ b/include/svx/xdash.hxx
@@ -31,32 +31,32 @@
class SVXCORE_DLLPUBLIC XDash final
{
css::drawing::DashStyle eDash;
- sal_uInt32 nDotLen;
sal_uInt16 nDots;
sal_uInt16 nDashes;
- sal_uInt32 nDashLen;
- sal_uInt32 nDistance;
+ double nDotLen;
+ double nDashLen;
+ double nDistance;
public:
XDash(css::drawing::DashStyle eDash = css::drawing::DashStyle_RECT,
- sal_uInt16 nDots = 1, sal_uInt32 nDotLen = 20,
- sal_uInt16 nDashes = 1, sal_uInt32 nDashLen = 20, sal_uInt32 nDistance = 20);
+ sal_uInt16 nDots = 1, double nDotLen = 20,
+ sal_uInt16 nDashes = 1, double nDashLen = 20, double nDistance = 20);
bool operator==(const XDash& rDash) const;
void SetDashStyle(css::drawing::DashStyle eNewStyle) { eDash = eNewStyle; }
void SetDots(sal_uInt16 nNewDots) { nDots = nNewDots; }
- void SetDotLen(sal_uInt32 nNewDotLen) { nDotLen = nNewDotLen; }
+ void SetDotLen(double nNewDotLen) { nDotLen = nNewDotLen; }
void SetDashes(sal_uInt16 nNewDashes) { nDashes = nNewDashes; }
- void SetDashLen(sal_uInt32 nNewDashLen) { nDashLen = nNewDashLen; }
- void SetDistance(sal_uInt32 nNewDistance) { nDistance = nNewDistance; }
+ void SetDashLen(double nNewDashLen) { nDashLen = nNewDashLen; }
+ void SetDistance(double nNewDistance) { nDistance = nNewDistance; }
css::drawing::DashStyle GetDashStyle() const { return eDash; }
sal_uInt16 GetDots() const { return nDots; }
- sal_uInt32 GetDotLen() const { return nDotLen; }
+ double GetDotLen() const { return nDotLen; }
sal_uInt16 GetDashes() const { return nDashes; }
- sal_uInt32 GetDashLen() const { return nDashLen; }
- sal_uInt32 GetDistance() const { return nDistance; }
+ double GetDashLen() const { return nDashLen; }
+ double GetDistance() const { return nDistance; }
// XDash is translated into an array of doubles which describe the lengths of the
// dashes, dots and empty passages. It returns the complete length of the full DashDot