Skip to content

Commit

Permalink
Merge pull request #7229 from Abhinavcode13/patch-1
Browse files Browse the repository at this point in the history
fix: added `WEBGL` mode for correct blendMode(SUBTRACT) behavior
  • Loading branch information
davepagurek authored Sep 9, 2024
2 parents 349b7d4 + aab2132 commit 67f7be6
Showing 1 changed file with 6 additions and 4 deletions.
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

0 comments on commit 67f7be6

Please sign in to comment.