Skip to content

[p5.js 2.0 Bug Report]: unexpected behavior from bezier method of graphics object #7821

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

Open
1 of 17 tasks
Ufuueueuru opened this issue May 15, 2025 · 1 comment
Open
1 of 17 tasks

Comments

@Ufuueueuru
Copy link

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

v2.0.1

Web browser and version

Firefox 138.0.1

Operating system

Windows 11

Steps to reproduce this

Steps:

  1. Use createGraphics to initialize a p5 graphics buffer
  2. Run the bezier method within said graphics buffer

It appears that the bezier method within a graphics buffer has the exact behavior as using the global bezier method, drawing to the canvas instead of the graphics buffer. This behavior did not occur in v1.11.5

Snippet:

let g;

function setup() {
  createCanvas(400, 400);
  
  g = createGraphics(200, 200);
}

function draw() {
  g.background(0);
  g.stroke(255, 0, 0);
  g.strokeWeight(5);
  g.noFill();
  g.bezier(0, 0, 100, 0, 0, 100, 200, 200);
  
  
  //Comment out this line and for some reason the bezier gets drawn (to the canvas instead of the graphics object)
  //image(g, 0, 0, 400, 400);
}

Here is the example in the online editor:
https://editor.p5js.org/Ufuueueuru/sketches/IV_tAs3qU
Notice how in the example the bezier is drawn without any of the stroke color, fill color, and weight changes in v2.0.1, but drawn correctly with those attributes in v1.11.5

Copy link

welcome bot commented May 15, 2025

Welcome! 👋 Thanks for opening your first issue here! And to ensure the community is able to respond to your issue, please make sure to fill out the inputs in the issue forms. Thank you!

@ksen0 ksen0 added the Bug label May 16, 2025
@ksen0 ksen0 moved this to Open for Discussion in p5.js 2.x 🌱🌳 May 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Open for Discussion
Development

No branches or pull requests

2 participants