TAChart: DatapointCrossHairTool flickering when mouse is moved around a data point
- Lazarus/FPC Version: Laz 2.2.0/FPC 3.2.2, Laz-main/FPC 3.2.2, but probably also in older versions
- Operating System: Windows
- CPU / Bitness: 32bit, or 64 bit
What happens
When a datapoint crosshair tool is attached to a chart to track data points with the mouse occasionally severe flickering is observed when the mouse is moved around a data point within the snap region of the tool.
This happens when the tool works in "xor mode" (but not in "normal mode"), and when the crosshair cursor is drawn with a width > 1.
The effect certainly occurs on Windows, it does not occur on Linux/gtk2.
What did you expect
No flicker when the mouse is moved.
Steps to reproduce
Run the attached demo program. It show three random series and displays a crosshair cursor when the mouse is moved close enough to a data point. When the mouse is moved around the data point (within the "GrabRadius" of the tool which is 32 pixels in the demo) the cross-hair cursor sticks to the data point (this is intentional), but the cursor flickers severely, mostly the horizontal line.
When the DrawingMode of the tool is switched to normal mode the flicker is gone. The flicker disappears also (mostly) when the width of the crosshair cursor is reduced to 1.
Note
This issue was brought up by user kupferstecher of the German Lazarus forum: https://www.lazarusforum.de/viewtopic.php?p=125835. He also presented a patch in the forum discussion.