Skip to content

Commit

Permalink
Merge pull request #7159 from zeesworth/fix_smooth_function
Browse files Browse the repository at this point in the history
Fix unnecessary console warnings when using smooth() on P2D Graphics objects
  • Loading branch information
davepagurek authored Aug 6, 2024
2 parents 0fd5a09 + c74baed commit b99f57f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/core/shape/attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -375,11 +375,12 @@ p5.prototype.rectMode = function(m) {
* </div>
*/
p5.prototype.smooth = function() {
this.setAttributes('antialias', true);
if (!this._renderer.isP3D) {
if ('imageSmoothingEnabled' in this.drawingContext) {
this.drawingContext.imageSmoothingEnabled = true;
}
} else {
this.setAttributes('antialias', true);
}
return this;
};
Expand Down

0 comments on commit b99f57f

Please sign in to comment.