From 11b92b26c8451d44bc9f7716ba6c2e26d6ed5531 Mon Sep 17 00:00:00 2001 From: wp_xyz Date: Sat, 29 Jul 2023 00:36:46 +0200 Subject: [PATCH] LCL/SpeedButton: Fix position of caption when no glyph is present. --- lcl/include/speedbutton.inc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lcl/include/speedbutton.inc b/lcl/include/speedbutton.inc index 2bc3db0839..28d3434bf8 100644 --- a/lcl/include/speedbutton.inc +++ b/lcl/include/speedbutton.inc @@ -720,11 +720,11 @@ begin OffsetGlyph.X:= M; OffsetGlyph.Y:= (ClientSize.cy - GlyphHeight) div 2; if (Margin >= 0) and (Spacing >= 0) then - OffsetCap.X := OffsetGlyph.X + GlyphWidth + Spacing + OffsetCap.X := OffsetGlyph.X + GlyphWidth + S else begin if Spacing >= 0 then - OffsetCap.X := OffsetGlyph.X + GlyphWidth + Spacing + OffsetCap.X := OffsetGlyph.X + GlyphWidth + S else OffsetCap.X := (OffsetGlyph.X + ClientSize.CX - TextSize.CX) div 2; end; @@ -739,7 +739,7 @@ begin else begin if Spacing >= 0 then - OffsetCap.X := OffsetGlyph.X - Spacing - TextSize.CX + OffsetCap.X := OffsetGlyph.X - S - TextSize.CX else OffsetCap.X := (OffsetGlyph.X - TextSize.CX) div 2; end;