summaryrefslogtreecommitdiff
path: root/drawinglayer
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2014-01-20 12:30:11 -0500
committerKohei Yoshida <kohei.yoshida@collabora.com>2014-01-20 14:37:04 -0500
commit4b2b4133c2bd750a4b71230433dba0e41ced0abe (patch)
tree167682e149918b981dfed9891f1719f10117790f /drawinglayer
parent01104522ef890bb535994311e627ba1bbfff023c (diff)
Handle double lines for screen rendering.
Double lines are always drawn as 2 parallel hair lines that are 1 pixel apart, at any zoom level. Change-Id: I2796477d0ea45c9880aa8057bd1a10104df96673
Diffstat (limited to 'drawinglayer')
-rw-r--r--drawinglayer/source/processor2d/vclpixelprocessor2d.cxx22
1 files changed, 20 insertions, 2 deletions
diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
index 439ce616977d..61145f529f44 100644
--- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
@@ -297,11 +297,14 @@ namespace drawinglayer
switch (rSource.getStyle())
{
case table::BorderLineStyle::SOLID:
+ case table::BorderLineStyle::DOUBLE:
{
const basegfx::BColor aLineColor =
maBColorModifierStack.getModifiedColor(rSource.getRGBColorLeft());
double nThick = rtl::math::round(rSource.getLeftWidth());
+ bool bDouble = rSource.getStyle() == table::BorderLineStyle::DOUBLE;
+
basegfx::B2DPolygon aTarget;
if (bHorizontal)
@@ -314,12 +317,20 @@ namespace drawinglayer
basegfx::B2DRange aRange = aTarget.getB2DRange();
double fH = aRange.getHeight();
- if (fH <= 1.0)
+ if (fH <= 1.0 || bDouble)
{
// Draw it as a line.
drawHairLine(
mpOutputDevice, aRange.getMinX(), aRange.getMinY(), aRange.getMaxX(), aRange.getMinY(),
aLineColor);
+
+ if (bDouble)
+ {
+ drawHairLine(
+ mpOutputDevice, aRange.getMinX(), aRange.getMinY()+2.0, aRange.getMaxX(), aRange.getMinY()+2.0,
+ aLineColor);
+ }
+
return true;
}
}
@@ -333,12 +344,19 @@ namespace drawinglayer
basegfx::B2DRange aRange = aTarget.getB2DRange();
double fW = aRange.getWidth();
- if (fW <= 1.0)
+ if (fW <= 1.0 || bDouble)
{
// Draw it as a line.
drawHairLine(
mpOutputDevice, aRange.getMinX(), aRange.getMinY(), aRange.getMinX(), aRange.getMaxY(),
aLineColor);
+
+ if (bDouble)
+ {
+ drawHairLine(
+ mpOutputDevice, aRange.getMinX()+2.0, aRange.getMinY(), aRange.getMinX()+2.0, aRange.getMaxY(),
+ aLineColor);
+ }
return true;
}
}