Bitmap Polyline issues.

I built the latest master.

Many things behaving nicer but this is something I notice.
I’m not sure if we need another issue for this or not?

https://youtu.be/0DyrH3E-clg

@jonasthomas Yeah I reported that as a consequence of a bigger behaviour issue here:

When you press ESC, I affectionately named them “Ghost lines”. That polyline tool sure is begging for some love haha.

Although I’ve been thinking that a main problem we might need to address is related to how pencil manages it’s screen or canvas display. Which seems to conveniently amplify the inherent polyline issues. I don’t know if it’s the graphics library or what but the polyline tool displays the widest array of graphical “glitches” apart form any other tool.

I think striving to make the screen to update properly would be a great step to improve pencil’s structure to handle these kind of tools.

I don’t know how it’s setup right now, but is it too difficult to make the screen update in real-time or at least while using any tool?

Looking back on that bug report It seems I didn’t record the exact procedure that you did (which would have been nice I reckon) but It is the same bug, of that I’m sure.

If you don’t mind I’m going to add your video to the original bug report :slight_smile:

sure

I created a small somewhat rambling video comparing/contrasting behavior between FreeCad and and Pencil2d. I think there’s some click/keystroke behavior that needs to be refined.

Freecad-Pencil Polyline Comparison

One thought that’s been bouncing around in my head, is if it really makes sense to have a polyline tool in bitmap mode.
I could see at some point in the feature, have a polyline in vector mode, selecting the polyline and tugging on a node and having the lines follow the node being moved.
I haven’t dug into the underlying data structures the vector mode, but it looks like you have multiple polylines stored in one layer-frame, where the bitmap all gets merged together. Having the PolylineTool object process handle both seems to me that we will be fixing something for bitmap and causing it to break in vector and vise-versa…
My inclination would be to allow the PolylineTool to be available only in the Vector mode. I would like consensus on that before I go that route.

I cross referenced this to this github issue https://github.com/pencil2d/pencil/issues/423#

Yes @jonas, this is the exact issue behaviour that I experienced with the polyline tool. Your video explain it visually

I found out another thing about the polyline tool
After applying some polyline strokes, the “clear frame” feature on the Tools panel does not work.

It will work if a different tool is used for adding some strokes to the last ones. Just hit “clear frame” this time and it will work OK.