Commit 2be2e6f
committed
Fix: Refine canvas expansion logic for selection-based tools
This commit continues the work from PR zero01101#180 to address issues with canvas expansion, particularly for the stamp tool, selection tool, and dream tool.
Key changes:
- Canvas expansion for the stamp tool now only occurs upon actual stamping (on click/draw), not during cursor movement. The bounding box calculation for expansion has been corrected to accurately reflect the stamp's dimensions and placement.
- Reviewed and confirmed that `js/lib/layers.js` correctly handles calls to `recalculateBg()`, only triggering it when the canvas dimensions actually change.
- Ensured that `js/ui/tool/select.js` and `js/ui/tool/dream.js` also follow the principle of expanding the canvas only when an action (like finalizing a selection or initiating image generation) necessitates it.
These changes aim to resolve issues where the canvas would expand excessively, leading to high VRAM usage and potential tool breakage, as discussed in PR zero01101#180. The overall behavior should now be more robust and user-friendly, with canvas expansion happening predictably and only when required.1 parent cc53647 commit 2be2e6f
1 file changed
Lines changed: 33 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
419 | 419 | | |
420 | 420 | | |
421 | 421 | | |
422 | | - | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
423 | 455 | | |
424 | 456 | | |
425 | 457 | | |
| |||
0 commit comments