pencil icon indicating copy to clipboard operation
pencil copied to clipboard

Canvas not updating properly when view updates occur while some tools are active

Open scribblemaniac opened this issue 1 year ago • 1 comments

Issue Summary

When some tools are actively being used (mostly notably while drawing a path with the polyline tool), triggering some view events, such as zooming in or out, or toggling overlays will not update the whole canvas as it should.

Actual Results

With a polyline path active, when zooming with the mouse wheel or keyboard shortcuts, the region around the tool cursor (if active) will be updated right away. If zooming through the status or action bar, nothing is immediately updated. If zooming with the ctrl+right/middle click, everything updates right away. After moving the mouse, the area around the polyline tool path will update, but not anything outside of that. Similar behavior occurs when toggling overlays, clearing the frame, or switching frames. When drawing with a drawing tool, less actions are possible, but this still occurs when zooming in or out with the keyboard shortcuts while actively drawing a stroke.

Expected Results

When taking "full canvas" actions such as zooming or toggling overlays, the entire canvas should be forced to update, or at the very least all the parts with content.

Video or Image Reference

Zoom Update Issue.webm

Steps to reproduce

Example:

  1. Start drawing a polyline path.
  2. Scroll with the mouse wheel

System Information

  • Pencil2D Version: d904335
  • Operating System: Ubuntu 22.04
  • RAM Size: 16GB
  • Graphics Tablet: N/A

scribblemaniac avatar Apr 29 '24 00:04 scribblemaniac

This happens because of some shared logic in scribblearea::updateFrame and ScribbleArea::invalidateAllCache

if (currentTool()->isActive() && currentTool()->isDrawingTool()) { return; }

I've addressed it in my pull request (#1910) but I only added a case for the polyline. If this applies anywhere else, I think it could be a quick fix .

Goodfite4 avatar Apr 04 '25 14:04 Goodfite4