Remove auto mask loading docs and clean up code comments

Deleted documentation files related to automatic mask loading. Cleaned up and streamlined comments across Canvas.js, CanvasInteractions.js, CanvasLayers.js, CanvasView.js, MaskTool.js, mask_utils.js, and example scripts for improved clarity and maintainability. No functional changes to core logic.
This commit is contained in:
Dariusz L
2025-07-01 06:42:20 +02:00
parent 30fb89451f
commit a0ceb3b97c
9 changed files with 126 additions and 642 deletions

View File

@@ -162,7 +162,7 @@ export class MaskTool {
if (this.brushHardness === 1) {
this.maskCtx.strokeStyle = `rgba(255, 255, 255, ${this.brushStrength})`;
} else {
// hardness: 1 = hard edge, 0 = soft edge
const innerRadius = gradientRadius * this.brushHardness;
const gradient = this.maskCtx.createRadialGradient(
canvasX, canvasY, innerRadius,
@@ -281,18 +281,16 @@ export class MaskTool {
}
setMask(image) {
// `this.x` i `this.y` przechowują pozycję lewego górnego rogu płótna maski
// względem lewego górnego rogu widoku. Zatem (-this.x, -this.y) to pozycja
// lewego górnego rogu widoku na płótnie maski.
const destX = -this.x;
const destY = -this.y;
// Wyczyść tylko ten obszar na dużym płótnie maski, który odpowiada
// widocznemu obszarowi wyjściowemu.
this.maskCtx.clearRect(destX, destY, this.canvasInstance.width, this.canvasInstance.height);
// Narysuj nowy obraz maski (który ma rozmiar obszaru wyjściowego)
// dokładnie w tym wyczyszczonym miejscu.
this.maskCtx.drawImage(image, destX, destY);
if (this.onStateChange) {