Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

erase() is broken for versions past 1.9.0 #7442

Closed
3 of 17 tasks
RandomGamingDev opened this issue Dec 21, 2024 · 1 comment
Closed
3 of 17 tasks

erase() is broken for versions past 1.9.0 #7442

RandomGamingDev opened this issue Dec 21, 2024 · 1 comment

Comments

@RandomGamingDev
Copy link
Contributor

Most appropriate sub-area of p5.js?

  • Accessibility
  • Color
  • Core/Environment/Rendering
  • Data
  • DOM
  • Events
  • Image
  • IO
  • Math
  • Typography
  • Utilities
  • WebGL
  • Build process
  • Unit testing
  • Internationalization
  • Friendly errors
  • Other (specify if possible)

p5.js version

1.9.1+

Web browser and version

Firefox 133.0.3 & Chromium 131.0.6778.85

Operating system

Debian 12

Steps to reproduce this

Steps:

  1. Draw something to a framebuffer
  2. Erase something from the frame buffer by drawing a shape using erase()
  3. Draw the frame buffer to the canvas and watch as the parts of the frame buffer meant to still have colors get turned transparent through the canvas and the transparent area including the part that was meant to be erased turn into the background color of the canvas.

Snippet:

let b;
function setup() {
  createCanvas(400, 400, WEBGL);
  b = createFramebuffer();
}

function draw() {
  background(0);
  
  b.begin()
  {
    fill(255,0,0)
    noStroke()
    rect(-100,-100,200,200)

    erase()       // This is Erasing the Main Canvas, rather than the framebuffer
    circle(0,0,100)
    noErase()
  }
  b.end()
  
  image(b,-200,-200)
}

Related to issue #6523 where erase() wouldn't work at all. It was originally fixed, but in versions past 1.9.0 it's now broken in the way described above instead of no longer functioning.

@davepagurek
Copy link
Contributor

Just merged in #7443, this should be good in 2.0 now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants