From c7a32dab567cce8ee435c65299ec60b638700a35 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 6 May 2022 09:55:29 +0100 Subject: Related: tdf#148433 use a slightly different cursor directional indicator MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- vcl/source/window/cursor.cxx | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'vcl') 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); -- cgit