@candyface I'm having an issue with the polyline tool where undoing the line will not update the canvas painter. After looking at this, do you think that issue is related to this one? or should I report it as an individual issue? I'm asking mostly because I saw your fix involves the canvas painter rendering.
The bug I'm having I can reproduce like this:
Draw a complete stroke with the polyline in the bitmap layer
Undo the stroke. You'll notice however that the stroke is still visible
Create a new stroke and you'll notice the old one will disappear (the canvas painter render is updated I suppose)