vcl/source/window/cursor.cxx |   14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

New commits:
commit c7a32dab567cce8ee435c65299ec60b638700a35
Author:     Caolán McNamara <[email protected]>
AuthorDate: Fri May 6 09:55:29 2022 +0100
Commit:     Caolán McNamara <[email protected]>
CommitDate: Fri May 6 13:10:35 2022 +0200

    Related: tdf#148433 use a slightly different cursor directional indicator
    
    make the rtl/ltr direction arrow equilateral and typically a little
    larger
    
    Change-Id: I9b233b76380865052b2112fda47009ae08c306af
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133925
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <[email protected]>

diff --git a/vcl/source/window/cursor.cxx b/vcl/source/window/cursor.cxx
index 45f2f6d46282..6a186da9432c 100644
--- a/vcl/source/window/cursor.cxx
+++ b/vcl/source/window/cursor.cxx
@@ -68,16 +68,19 @@ static tools::Rectangle 
ImplCursorInvert(vcl::RenderContext* pRenderContext, Imp
             if ( pData->mnDirection != CursorDirection::NONE)
             {
                 Point pAry[7];
-                int delta = 3*aRect.getWidth()+1;
+                // Related system settings for "delta" could be:
+                // gtk cursor-aspect-ratio and  windows SPI_GETCARETWIDTH
+                int delta = (aRect.getHeight() * 4 / 100) + 1;
                 if( pData->mnDirection == CursorDirection::LTR )
                 {
                     // left-to-right
                     pAry[0] = aPoly.GetPoint( 0 );
                     pAry[1] = aPoly.GetPoint( 1 );
                     pAry[2] = pAry[1];
-                    pAry[2].AdjustX(delta );
+                    pAry[2].AdjustX(delta);
+                    pAry[2].AdjustY(delta);
                     pAry[3] =  pAry[1];
-                    pAry[3].AdjustY(delta );
+                    pAry[3].AdjustY(delta * 2);
                     pAry[4] = aPoly.GetPoint( 2 );
                     pAry[5] = aPoly.GetPoint( 3 );
                     pAry[6] = aPoly.GetPoint( 4 );
@@ -90,9 +93,10 @@ static tools::Rectangle ImplCursorInvert(vcl::RenderContext* 
pRenderContext, Imp
                     pAry[2] = aPoly.GetPoint( 2 );
                     pAry[3] = aPoly.GetPoint( 3 );
                     pAry[4] = pAry[0];
-                    pAry[4].AdjustY(delta );
+                    pAry[4].AdjustY(delta*2);
                     pAry[5] =  pAry[0];
-                    pAry[5].AdjustX( -delta );
+                    pAry[5].AdjustX(-delta);
+                    pAry[5].AdjustY(delta);
                     pAry[6] = aPoly.GetPoint( 4 );
                 }
                 aPoly = tools::Polygon( 7, pAry);

Reply via email to