TAChart: Fix TChartListbox using more than 1 column, issue #39439

This commit is contained in:
wp_xyz 2021-10-23 21:59:35 +02:00
parent 6422aaa213
commit c3f0740005

View File

@ -257,10 +257,10 @@ begin
inherited;
end;
{ Based on the rect of a listbox item, calculates the locations of the
checkbox and of the series icon }
procedure TChartListbox.CalcRects(
const AItemRect: TRect; out ACheckboxRect, ASeriesIconRect: TRect);
{ based on the rect of a listbox item, calculates the locations of the
checkbox and of the series icon }
const
MARGIN = 4;
var
@ -274,11 +274,7 @@ begin
ACheckBoxRect := Rect(0, 0, FCheckboxSize.CX, FCheckboxSize.CY);
OffsetRect(ACheckboxRect, x, (AItemRect.Top + AItemRect.Bottom - FCheckboxSize.CY) div 2);
if cloShowIcons in Options then
x += ACheckboxRect.Right;
end
else begin
if cloShowIcons in Options then
x += AItemRect.Left;
x := ACheckboxRect.Right + MARGIN;
end;
if cloShowIcons in Options then
begin