Skip to content

Commit

Permalink
Fixed clearing-rect issue after position change. It now clears the ex…
Browse files Browse the repository at this point in the history
…act area the image is drawn. The window is ignored now.
  • Loading branch information
Arcus92 committed Nov 7, 2024
1 parent d9814ce commit b3c6cd4
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,15 @@ export class Renderer {
compositionObject.horizontalPosition, compositionObject.verticalPosition,
compositionObject.croppingHorizontalPosition, compositionObject.croppingVerticalPosition,
compositionObject.croppingWidth, compositionObject.croppingHeight);

dirtyArea?.union(compositionObject.horizontalPosition, compositionObject.verticalPosition,
compositionObject.croppingWidth, compositionObject.croppingHeight);
} else {
this.context?.putImageData(compositionData.pixelData,
compositionObject.horizontalPosition, compositionObject.verticalPosition);
}

// Mark this area as dirty.
dirtyArea?.union(compositionData.window.horizontalPosition, compositionData.window.verticalPosition,
compositionData.pixelData.width, compositionData.pixelData.height);
dirtyArea?.union(compositionObject.horizontalPosition, compositionObject.verticalPosition,
compositionData.pixelData.width, compositionData.pixelData.height);
}
}
}

0 comments on commit b3c6cd4

Please sign in to comment.