Skip to content

Commit

Permalink
Deleted black border on mask for editing (causing bug)
Browse files Browse the repository at this point in the history
  • Loading branch information
aduboue committed Jan 14, 2025
1 parent 8922e13 commit dc765eb
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
5 changes: 0 additions & 5 deletions app/ui/edit-components/OutpaintPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -216,11 +216,6 @@ async function generateMaskFromCanvas(
// Draw the modified image data back onto the canvas
maskCtx.putImageData(imageData, 0, 0)

// Add a black border added to indicate mask shape
maskCtx.strokeStyle = 'black'
maskCtx.lineWidth = 1
maskCtx.strokeRect(1, 1, maskSize.width - 2, maskSize.height - 2)

// Convert the canvas content to a data URL
const base64data = maskCanvas.toDataURL('image/png')

Expand Down
9 changes: 1 addition & 8 deletions app/ui/edit-components/SetMaskDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,7 @@ export default function SetMaskDialog({
throw Error(errorMsg)
}

// Add a black border added to indicate mask shape
const maskWithBorder = await addBorderToBase64Image(res)
setMaskImage(maskWithBorder)
setMaskImage(res)

const newMaskPreview = await createMaskPreview(res, maskSize)
setMaskPreview(newMaskPreview)
Expand Down Expand Up @@ -235,11 +233,6 @@ export default function SetMaskDialog({
canvas.height = newHeight
ctx.drawImage(img, 0, 0, newWidth, newHeight)

// Add a black border added to indicate mask shape
ctx.strokeStyle = 'black'
ctx.lineWidth = 1
ctx.strokeRect(1, 1, newWidth - 2, newHeight - 2)

return new Promise<string | null>((resolve) => {
canvas.toBlob(async (blob) => {
if (blob) {
Expand Down

0 comments on commit dc765eb

Please sign in to comment.