I have separated the drawing logic of the editing controls from the sketch drawing logic:
The ScribblePainter is now only used to draw the sketch, hence it's arguments are replaced with just the sketch.
The editing controls are drawn by the new ScribbleEditingPainter.
The Problem was, that the sketch got drawn every time the editing controls changed. These include information about the active tool, etc. and the most hurting of them: The active line and the pointer position. Since these change every frame, the user is editing the sketch, the hole sketch gets rendered every frame, making the repaint boundary useless, that is introduced in the Scribble widget!
Note that the user will instantly notice very slight frame drops, when actively drawing, but does not, if the last frame, in which he takes up the pen, takes way longer, because the screen does not change in this time anyways. That is why we should make the frames, in which the user is drawing very very fast, and shove every big operation to the end of the interaction!
I have separated the drawing logic of the editing controls from the sketch drawing logic:
The Problem was, that the sketch got drawn every time the editing controls changed. These include information about the active tool, etc. and the most hurting of them: The active line and the pointer position. Since these change every frame, the user is editing the sketch, the hole sketch gets rendered every frame, making the repaint boundary useless, that is introduced in the Scribble widget!
Note that the user will instantly notice very slight frame drops, when actively drawing, but does not, if the last frame, in which he takes up the pen, takes way longer, because the screen does not change in this time anyways. That is why we should make the frames, in which the user is drawing very very fast, and shove every big operation to the end of the interaction!