[Libreoffice-commits] core.git: Branch 'feature/calc-cell-borders' - drawinglayer/source
Kohei Yoshida
kohei.yoshida at collabora.com
Mon Jan 20 09:30:03 PST 2014
drawinglayer/source/processor2d/vclpixelprocessor2d.cxx | 22 ++++++++++++++--
1 file changed, 20 insertions(+), 2 deletions(-)
New commits:
commit 80187cb4faeb7426dcb565abe43f5616b4e9d8a8
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date: Mon Jan 20 12:30:11 2014 -0500
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
diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
index 439ce61..61145f5 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;
}
}
More information about the Libreoffice-commits
mailing list