Prevent offscreen drawing resulting in wrapped drawing

main
kts of kettek 2024-02-16 13:02:45 -08:00
parent e6a28635f8
commit 5813cfabdb
1 changed files with 2 additions and 0 deletions

View File

@ -91,6 +91,8 @@ export class BrushTool implements Tool {
let x = Math.floor(this.lastX + Math.cos(angle) * i)
let y = Math.floor(this.lastY + Math.sin(angle) * i)
if (x < 0 || y < 0 || x >= ctx.file.canvas.width || y >= ctx.file.canvas.height) continue
if (ctx.brushSize == 1) {
let p = ctx.file.canvas.getPixel(x, y)
if (p !== -1) {