mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-21 19:39:17 +02:00
TAChart: Fix occasional flicker of datapoint crosshair tool. Issue #39548, patch by kupferstecher.
(cherry picked from commit 3b9e6859e7
)
This commit is contained in:
parent
1ff6697784
commit
191e203993
@ -2234,14 +2234,29 @@ end;
|
||||
procedure TDataPointCrosshairTool.MouseMove(APoint: TPoint);
|
||||
var
|
||||
id: IChartDrawer;
|
||||
lastSeries, currentSeries: TBasicChartSeries;
|
||||
lastIndex: Integer;
|
||||
xorMode: Boolean;
|
||||
begin
|
||||
id := GetCurrentDrawer;
|
||||
if Assigned(id) then
|
||||
DoHide(id);
|
||||
lastSeries := FSeries;
|
||||
lastIndex := FPointIndex;
|
||||
xorMode := EffectiveDrawingMode = tdmXOR;
|
||||
|
||||
FSeries := nil;
|
||||
FindNearestPoint(APoint);
|
||||
|
||||
if xorMode and (FSeries = lastSeries) and (FPointIndex = lastIndex) and (FPointIndex > -1) then exit;
|
||||
currentSeries := FSeries;
|
||||
|
||||
FSeries := lastSeries;
|
||||
if Assigned(id) then DoHide(id);
|
||||
|
||||
FSeries := currentSeries;
|
||||
if FSeries = nil then exit;
|
||||
|
||||
FPosition := FNearestGraphPoint;
|
||||
if (EffectiveDrawingMode = tdmXor) and Assigned(id) then begin
|
||||
if xorMode and Assigned(id) then begin
|
||||
id.SetXor(true);
|
||||
DoDraw(id);
|
||||
id.SetXor(false);
|
||||
|
Loading…
Reference in New Issue
Block a user