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

fix: added WEBGL mode for correct blendMode(SUBTRACT) behavior #7229

Merged
merged 6 commits into from
Sep 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/core/rendering.js
Original file line number Diff line number Diff line change
Expand Up @@ -1158,23 +1158,25 @@ p5.prototype.clearDepth = function(depth) {
* <div>
* <code>
* function setup() {
* createCanvas(100, 100);
* // Create a canvas with WEBGL mode.
* createCanvas(100, 100, WEBGL);
*
* // Set the background color.
* background(200);
*
* // Set the blend mode.
* // Set the blend mode to SUBTRACT.
* blendMode(SUBTRACT);
*
* // Style the lines.
* strokeWeight(30);
*
* // Draw the blue line.
* stroke('blue');
* line(25, 25, 75, 75);
* line(-25, -25, 25, 25);
*
* // Draw the red line.
* stroke('red');
* line(75, 25, 25, 75);
* line(25, -25, -25, 25);
*
* describe('A yellow line and a turquoise line form an X on a gray background. The area where they overlap is green.');
* }
Expand Down
Loading