summaryrefslogtreecommitdiff
path: root/drawinglayer
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2014-03-17 19:11:35 -0400
committerTor Lillqvist <tml@collabora.com>2014-03-25 11:40:14 +0200
commit49fde3225196bcd47c6f60734484b31b21441577 (patch)
tree5737c91c00bb345ad165417db2d4e62c8fdc008f /drawinglayer
parentdfc5354c9ad77655d2da0d8eea8c2fec7a31ed32 (diff)
fdo#75260: Improve double line drawing for writer table.
(cherry picked from commit 1c6fb266567c8e397e3c65663b21f0fa50696aa5) (cherry picked from commit 77b6c1602aaa0bd059077765e7fabb53d9e6ddeb) (cherry picked from commit 32391d25293935fbbf0075e3ccf68625951427f0) (cherry picked from commit 24b4fbfa39f212c769bf4d966258a8fb4c98c201) (cherry picked from commit 07909e0045d9f94329861fe2e7b3403a5c4befed) (cherry picked from commit 335470edf00cabb47abb9d7dcc4dd3a5a0e79616) Change-Id: Id350531f09b3ded66fd05ea7ebeefe8771260b62 Reviewed-on: https://gerrit.libreoffice.org/8635 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'drawinglayer')
-rw-r--r--drawinglayer/source/primitive2d/borderlineprimitive2d.cxx56
1 files changed, 26 insertions, 30 deletions
diff --git a/drawinglayer/source/primitive2d/borderlineprimitive2d.cxx b/drawinglayer/source/primitive2d/borderlineprimitive2d.cxx
index 67efa09da581..7b9348dc6fec 100644
--- a/drawinglayer/source/primitive2d/borderlineprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/borderlineprimitive2d.cxx
@@ -183,37 +183,33 @@ primitive2d::Primitive2DReference makeSolidLinePrimitive(
xRetval.realloc(2);
- {
- // "inside" line
- double fWidth = getLeftWidth();
- basegfx::BColor aColor = getRGBColorLeft();
- bool bIsHairline = lcl_UseHairline(
- fWidth, getStart(), getEnd(), rViewInformation);
- fWidth = lcl_GetCorrectedWidth(fWidth,
- getStart(), getEnd(), rViewInformation);
-
- if (bIsHairline)
- xRetval[0] = makeHairLinePrimitive(getStart(), getEnd(), aVector, aColor, 0.0);
- else
- xRetval[0] = makeSolidLinePrimitive(
- aClipRegion, aTmpStart, aTmpEnd, aVector, aColor, fWidth, 0.0);
- }
+ double fLeftWidth = getLeftWidth();
+ bool bLeftHairline = lcl_UseHairline(fLeftWidth, getStart(), getEnd(), rViewInformation);
+ if (bLeftHairline)
+ fLeftWidth = 0.0;
- {
- // "outside" line
- double fWidth = getRightWidth();
- basegfx::BColor aColor = getRGBColorRight();
- bool bIsHairline = lcl_UseHairline(
- fWidth, getStart(), getEnd(), rViewInformation);
- fWidth = lcl_GetCorrectedWidth(fWidth,
- getStart(), getEnd(), rViewInformation);
-
- if (bIsHairline)
- xRetval[1] = makeHairLinePrimitive(getStart(), getEnd(), aVector, aColor, mfDistance);
- else
- xRetval[1] = makeSolidLinePrimitive(
- aClipRegion, aTmpStart, aTmpEnd, aVector, aColor, fWidth, mfDistance);
- }
+ double fRightWidth = getRightWidth();
+ bool bRightHairline = lcl_UseHairline(fRightWidth, getStart(), getEnd(), rViewInformation);
+ if (bRightHairline)
+ fRightWidth = 0.0;
+
+ // "inside" line
+
+ if (bLeftHairline)
+ xRetval[0] = makeHairLinePrimitive(
+ getStart(), getEnd(), aVector, getRGBColorLeft(), 0.0);
+ else
+ xRetval[0] = makeSolidLinePrimitive(
+ aClipRegion, aTmpStart, aTmpEnd, aVector, getRGBColorLeft(), fLeftWidth, -fLeftWidth/2.0);
+
+ // "outside" line
+
+ if (bRightHairline)
+ xRetval[1] = makeHairLinePrimitive(
+ getStart(), getEnd(), aVector, getRGBColorRight(), fLeftWidth+mfDistance);
+ else
+ xRetval[1] = makeSolidLinePrimitive(
+ aClipRegion, aTmpStart, aTmpEnd, aVector, getRGBColorRight(), fRightWidth, mfDistance+fRightWidth/2.0);
}
else
{