Skip to content

Conversation

diyaayay
Copy link
Contributor

@diyaayay diyaayay commented Dec 17, 2023

Resolves #6621

Changes:
In src/webgl/p5.Camera.js :
if (far === undefined) far = Math.max(this._renderer.width, this._renderer.height)+800;

In test/unit/webgl/p5.Camera.js :
var expectedMatrix = new Float32Array([ 0.019999999552965164, 0, 0, 0, 0, -0.019999999552965164, 0, 0, 0, 0, -0.002222222276031971, 0, -0, -0, -1, 1 ]);

Screenshots of the change:

Before:
image

function setup() {
  createCanvas(400, 400, WEBGL);
  ortho();
}

function draw() {
  background(220);
  box(100);
}

image

function setup() {
  createCanvas(100, 100, WEBGL);
  ortho();
}

function draw() {
  background(220);
  box(50);
}

image

PR Checklist

@diyaayay
Copy link
Contributor Author

Waiting for a review. Perhaps @davepagurek or anyone?
Thanks.

Copy link
Contributor

@davepagurek davepagurek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for implementing the fix and updating the test!

@davepagurek davepagurek merged commit ce50455 into processing:main Dec 21, 2023
@davepagurek davepagurek mentioned this pull request Jan 21, 2024
17 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Due to #6216, If ortho() is used without arguments, drawing may fail in some cases
2 participants