diff options
author | Caolán McNamara <caolanm@redhat.com> | 2022-05-06 09:55:29 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2022-05-06 13:10:35 +0200 |
commit | c7a32dab567cce8ee435c65299ec60b638700a35 (patch) | |
tree | 362d538bcbe12287287efbe0cd16aac608acd0d9 /vcl | |
parent | 28c31ba12567f66ccb6a334fd21af10880f4a33b (diff) |
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 <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/window/cursor.cxx | 14 |
1 files changed, 9 insertions, 5 deletions
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); |