svx/source/stbctrls/pszctrl.cxx |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit 68b6d507342a440b5441882e74587054d530687b
Author:     Heiko Tietze <tietze.he...@gmail.com>
AuthorDate: Tue Mar 7 14:51:03 2023 +0100
Commit:     Heiko Tietze <heiko.tie...@documentfoundation.org>
CommitDate: Wed Mar 8 09:59:13 2023 +0000

    Vertically center statusbar images
    
    Change-Id: Iecdeeda5c10b2322bdf71e84864ed8104581589f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148424
    Tested-by: Jenkins
    Reviewed-by: Heiko Tietze <heiko.tie...@documentfoundation.org>

diff --git a/svx/source/stbctrls/pszctrl.cxx b/svx/source/stbctrls/pszctrl.cxx
index cd103e258600..76105b844028 100644
--- a/svx/source/stbctrls/pszctrl.cxx
+++ b/svx/source/stbctrls/pszctrl.cxx
@@ -449,8 +449,12 @@ void SvxPosSizeStatusBarControl::Paint( const 
UserDrawEvent& rUsrEvt )
             rRect.Left() + rRect.GetWidth() / 2 + PAINT_OFFSET;
         // draw position
         Point aPnt = rRect.TopLeft();
-        aPnt.setY( aItemPos.Y() );
         aPnt.AdjustX(PAINT_OFFSET );
+        // vertically centered
+        const tools::Long nSizePosY =
+            (rRect.GetHeight() - pImpl->aPosImage.GetSizePixel().Height()) / 2;
+        aPnt.AdjustY( nSizePosY );
+
         pDev->DrawImage( aPnt, pImpl->aPosImage );
         aPnt.AdjustX(pImpl->aPosImage.GetSizePixel().Width() );
         aPnt.AdjustX(PAINT_OFFSET );

Reply via email to