Skip to content

Commit

Permalink
Removed unnecessary functions
Browse files Browse the repository at this point in the history
  • Loading branch information
acamposuribe committed Dec 1, 2023
1 parent d759644 commit c851a26
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 32 deletions.
31 changes: 0 additions & 31 deletions p5.brush.js
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,6 @@
_r.pop();
// Clear the mask after drawing
mask.clear()
mask.reset()
}
// We cache the new color here
if (!_isLast) {
Expand Down Expand Up @@ -2674,36 +2673,6 @@
}
}


/**
* Extension of the p5.RendererGL prototype to fix the erase function for the WebGL renderer.
*/
p5.RendererGL.prototype.erase = function(opacityFill, opacityStroke) {
if (!this._isErasing) {
this._cachedBlendMode = this.curBlendMode;
this._isErasing = true;
this.blendMode('destination-out');
this._cachedFillStyle = this.curFillColor.slice();
this.curFillColor = [1, 1, 1, opacityFill / 255];
this._cachedStrokeStyle = this.curStrokeColor.slice();
this.curStrokeColor = [1, 1, 1, opacityStroke / 255];
}
}
/**
* Extension of the p5.RendererGL prototype to fix the noErase function for the WebGL renderer.
*/
p5.RendererGL.prototype.noErase = function() {
if (this._isErasing) {
this.curFillColor = this._cachedFillStyle.slice();
this.curStrokeColor = this._cachedStrokeStyle.slice();
let temp = this.curBlendMode;
this.blendMode(this._cachedBlendMode);
this._cachedBlendMode = temp;
this._isErasing = false;
this._applyBlendMode();
}
}

// =============================================================================
// Section: Standard Brushes
// =============================================================================
Expand Down
Loading

0 comments on commit c851a26

Please sign in to comment.