Skip to content

[p5.js 2.0 Bug Report]: WebGPU mode seems to have the coordinate system little off? #8419

@msawired

Description

@msawired

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

2.2.0

Web browser and version

Chrome 143.0.7499.193

Operating system

MacOSX

Steps to reproduce this

In WebGPU mode, the coordinate system starts (0,0) from the center of the screen. Was this intended behavior?
If so, shouldn't mouseX and mouseY should reflect the (new) coordinate system position, such as (-10,-10)?

Image

Steps:

  1. See the sample sketch

Snippet:

async function setup() {
  await createCanvas(windowWidth, windowHeight, WEBGPU);
  // await createCanvas(windowWidth, windowHeight); //this works fine
}

function draw() {
	circle(0, 0, 20);
	circle(mouseX, mouseY, 20);
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions