sc/source/ui/view/output.cxx |   14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

New commits:
commit d395b42cdf3ef517d215dee905e5ccf2ae73b2b8
Author:     Heiko Tietze <tietze.he...@gmail.com>
AuthorDate: Tue Jan 17 17:58:53 2023 +0100
Commit:     Heiko Tietze <heiko.tie...@documentfoundation.org>
CommitDate: Wed Jan 18 08:22:08 2023 +0000

    Resolves tdf#91415 - Scale Calc's comment indicator with zoom level
    
    Avoids covering of content when zoomed out
    Shows the indicatior as a triangle now
    
    Change-Id: Icb613e0e728852dd2dfb6d52ad657a986d0c1a0c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145677
    Reviewed-by: Heiko Tietze <heiko.tie...@documentfoundation.org>
    Tested-by: Heiko Tietze <heiko.tie...@documentfoundation.org>

diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx
index 664eca6cb999..9b7ba7ea66ed 100644
--- a/sc/source/ui/view/output.cxx
+++ b/sc/source/ui/view/output.cxx
@@ -2422,7 +2422,7 @@ void ScOutputData::DrawNoteMarks(vcl::RenderContext& 
rRenderContext)
                         bFirst = false;
                     }
 
-                    tools::Long nMarkX = nPosX + ( 
pRowInfo[0].basicCellInfo(nX).nWidth - 4 ) * nLayoutSign;
+                    tools::Long nMarkX = nPosX + ( 
pRowInfo[0].basicCellInfo(nX).nWidth - 2 ) * nLayoutSign;
                     if ( bIsMerged || pInfo->bMerged )
                     {
                         //  if merged, add widths of all cells
@@ -2433,8 +2433,18 @@ void ScOutputData::DrawNoteMarks(vcl::RenderContext& 
rRenderContext)
                             ++nNextX;
                         }
                     }
+                    // DPI/ZOOM 100/100 => 10, 100/50 => 7, 100/150 => 13
+                    // DPI/ZOOM 150/100 => 13, 150/50 => 8.5, 150/150 => 17.5
+                    const double nSize( rRenderContext.GetDPIScaleFactor() * 
aZoomX * 6 + 4);
+                    Point aPoints[3];
+                    aPoints[0] = Point(nMarkX, nPosY);
+                    aPoints[0].setX( bLayoutRTL ? aPoints[0].X() + nSize : 
aPoints[0].X() - nSize );
+                    aPoints[1] = Point(nMarkX, nPosY);
+                    aPoints[2] = Point(nMarkX, nPosY + nSize);
+                    tools::Polygon aPoly(3, aPoints);
+
                     if ( bLayoutRTL ? ( nMarkX >= 0 ) : ( nMarkX < nScrX+nScrW 
) )
-                        rRenderContext.DrawRect( tools::Rectangle( 
nMarkX-5*nLayoutSign,nPosY,nMarkX+1*nLayoutSign,nPosY+6 ) );
+                        rRenderContext.DrawPolygon(aPoly);
                 }
 
                 nPosX += pRowInfo[0].basicCellInfo(nX).nWidth * nLayoutSign;

Reply via email to