[Libreoffice-commits] core.git: drawinglayer/source sw/source

Kohei Yoshida kohei.yoshida at collabora.com
Tue Mar 18 10:59:39 PDT 2014


 drawinglayer/source/primitive2d/borderlineprimitive2d.cxx |    4 +-
 sw/source/core/layout/paintfrm.cxx                        |   21 --------------
 2 files changed, 3 insertions(+), 22 deletions(-)

New commits:
commit 07909e0045d9f94329861fe2e7b3403a5c4befed
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Tue Mar 18 13:54:28 2014 -0400

    fdo#75260: Center both primary and secondary lines wrt thier respective axes.
    
    The closed borders connect much better this way.  Now all double lines look
    at least half-way decent.
    
    Also, we shouldn't be doing any sort of pixel correction in the common code
    that gets used both raster and vector drawing modes.  In case we need to do
    some pixel correction, we should do it in the pixel processor code.
    
    Change-Id: I78e245c10752d0f4790a9ac664a14ce06571434e

diff --git a/drawinglayer/source/primitive2d/borderlineprimitive2d.cxx b/drawinglayer/source/primitive2d/borderlineprimitive2d.cxx
index b74061e..7b9348d 100644
--- a/drawinglayer/source/primitive2d/borderlineprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/borderlineprimitive2d.cxx
@@ -200,7 +200,7 @@ primitive2d::Primitive2DReference makeSolidLinePrimitive(
                             getStart(), getEnd(), aVector, getRGBColorLeft(), 0.0);
                     else
                         xRetval[0] = makeSolidLinePrimitive(
-                            aClipRegion, aTmpStart, aTmpEnd, aVector, getRGBColorLeft(), fLeftWidth, 0.0);
+                            aClipRegion, aTmpStart, aTmpEnd, aVector, getRGBColorLeft(), fLeftWidth, -fLeftWidth/2.0);
 
                     // "outside" line
 
@@ -209,7 +209,7 @@ primitive2d::Primitive2DReference makeSolidLinePrimitive(
                             getStart(), getEnd(), aVector, getRGBColorRight(), fLeftWidth+mfDistance);
                     else
                         xRetval[1] = makeSolidLinePrimitive(
-                            aClipRegion, aTmpStart, aTmpEnd, aVector, getRGBColorRight(), fRightWidth, fLeftWidth+mfDistance);
+                            aClipRegion, aTmpStart, aTmpEnd, aVector, getRGBColorRight(), fRightWidth, mfDistance+fRightWidth/2.0);
                 }
                 else
                 {
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index 18bfe6f..85ad6c7 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -2562,25 +2562,6 @@ void SwTabFrmPainter::PaintLines(OutputDevice& rDev, const SwRect& rRect) const
             else
                 pTmpColor = pHCColor;
 
-            // The line sizes stored in the line style have to be adjusted as
-            // well.  This will guarantee that lines with the same twip size
-            // will have the same pixel size.
-            for ( int i = 0; i < 7; ++i )
-            {
-                sal_uInt16 nPrim = aStyles[ i ].Prim();
-                sal_uInt16 nDist = aStyles[ i ].Dist();
-                sal_uInt16 nSecn = aStyles[ i ].Secn();
-
-                if (nPrim > 0)
-                    nPrim = (sal_uInt16)( std::max( 1L, nPixelSzH * ( nPrim / nPixelSzH ) ) );
-                if (nDist > 0)
-                    nDist = (sal_uInt16)( std::max( 1L, nPixelSzH * ( nDist / nPixelSzH ) ) );
-                if (nSecn > 0)
-                    nSecn = (sal_uInt16)( std::max( 1L, nPixelSzH * ( nSecn / nPixelSzH ) ) );
-
-                aStyles[ i ].Set( nPrim, nDist, nSecn );
-            }
-
             // The (twip) positions will be adjusted to meet these requirements:
             // 1. The y coordinates are located in the middle of the pixel grid
             // 2. The x coordinated are located at the beginning of the pixel grid
@@ -2800,7 +2781,7 @@ void calcOffsetForDoubleLine( SwLineEntryMap& rLines )
                 if (aLine.maAttribute.Secn())
                 {
                     // Apply offset only for double lines.
-                    aLine.mnOffset = static_cast<SwTwips>(aLine.maAttribute.Prim()+aLine.maAttribute.Dist());
+                    aLine.mnOffset = static_cast<SwTwips>(aLine.maAttribute.Dist());
                     aLine.mbOffsetPerp = true;
 
                     if (i == 0)


More information about the Libreoffice-commits mailing list