diff options
author | Armin Le Grand <Armin.Le.Grand@cib.de> | 2017-07-26 16:34:52 +0200 |
---|---|---|
committer | Armin Le Grand <Armin.Le.Grand@cib.de> | 2017-07-28 17:51:57 +0200 |
commit | 7202cfa0d3bae430f8fcb8508ed389583a14539b (patch) | |
tree | 034dc592b38cffaba2fbb1987615c2774bb2e6bb /sw | |
parent | 5e061435a74a5461e6b9fa5a48ce44d266a3d957 (diff) |
borderline: Unified primitive creation
Overhauled the edge extension calculations to better
use all existing cuts, for cases with single and double
lines. Also a preparation for more complex edge cuts.
Changed BorderLine paint in Writer, it was setting the
svx::frame::RefMode attribute at the Style *and*
was manually moving the geometry which lead to a
double applying of the offsets
Change-Id: I446d04632050272849f43accb8dcbde574d10cf4
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/layout/paintfrm.cxx | 45 |
1 files changed, 26 insertions, 19 deletions
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index 20c362b0f8e4..407ac441ecf7 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -2771,25 +2771,32 @@ void SwTabFramePainter::PaintLines(OutputDevice& rDev, const SwRect& rRect) cons // logically vertical lines are painted centered on the line, // logically horizontal lines are painted "below" the line - bool const isBelow((mrTabFrame.IsVertical()) ? !bHori : bHori); - double const offsetStart = (isBelow) - ? aStyles[0].GetWidth() / 2.0 - : std::max<double>(aStyles[1].GetWidth(), - aStyles[3].GetWidth()) / 2.0; - double const offsetEnd = (isBelow) - ? aStyles[0].GetWidth() / 2.0 - : std::max<double>(aStyles[4].GetWidth(), - aStyles[6].GetWidth()) / 2.0; - if (mrTabFrame.IsVertical()) - { - aPaintStart.X() -= static_cast<long>(offsetStart + 0.5); - aPaintEnd.X() -= static_cast<long>(offsetEnd + 0.5); - } - else - { - aPaintStart.Y() += static_cast<long>(offsetStart + 0.5); - aPaintEnd.Y() += static_cast<long>(offsetEnd + 0.5); - } + // + // This does not need to be done here, it is set in SwTabFramePainter::Insert + // already using SetRefMode(...) as property of the BorderLine Style, see there. + // When additionally adding the offset here manually, it will be applied + // double and will be rendered wrong. This did not happen before because + // the setting of the svx::frame::RefMode at svx::frame::Style was ignored there. + // + // bool const isBelow((mrTabFrame.IsVertical()) ? !bHori : bHori); + // double const offsetStart = (isBelow) + // ? aStyles[0].GetWidth() / 2.0 + // : std::max<double>(aStyles[1].GetWidth(), + // aStyles[3].GetWidth()) / 2.0; + // double const offsetEnd = (isBelow) + // ? aStyles[0].GetWidth() / 2.0 + // : std::max<double>(aStyles[4].GetWidth(), + // aStyles[6].GetWidth()) / 2.0; + // if (mrTabFrame.IsVertical()) + // { + // aPaintStart.X() -= static_cast<long>(offsetStart + 0.5); + // aPaintEnd.X() -= static_cast<long>(offsetEnd + 0.5); + // } + // else + // { + // aPaintStart.Y() += static_cast<long>(offsetStart + 0.5); + // aPaintEnd.Y() += static_cast<long>(offsetEnd + 0.5); + // } if (bHori) { |