LCL/SpeedButton: Fix position of caption when no glyph is present.

This commit is contained in:
wp_xyz 2023-07-29 00:36:46 +02:00
parent df99227b6b
commit 11b92b26c8

View File

@ -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;