[BUG] Polyline Tool deletes strokes around the cursor tip

Draw some straight lines with the Polyline Tool. It will delete its previous strokes when new lines are added close to them, even if they belong to a different frame/layer
It does not delete strokes from other drawing tools (pen, Pencil, Brush)