Skip to content

Commit 576b044

Browse files
author
Lauren McCarthy
committed
version 0.4.6
1 parent ad99a9a commit 576b044

File tree

2 files changed

+26
-12
lines changed

2 files changed

+26
-12
lines changed

lib/p5.js

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! p5.js v0.4.5 June 23, 2015 */
1+
/*! p5.js v0.4.6 June 24, 2015 */
22
(function (root, factory) {
33
if (typeof define === 'function' && define.amd)
44
define('p5', [], function () { return (root.returnExportsGlobal = factory());});
@@ -2517,13 +2517,27 @@ amdclean['core_p5Renderer2D'] = function (require, core_core, core_canvas, core_
25172517
return this;
25182518
};
25192519
p5.Renderer2D.prototype.noSmooth = function () {
2520-
this.drawingContext.mozImageSmoothingEnabled = false;
2521-
this.drawingContext.webkitImageSmoothingEnabled = false;
2520+
if ('imageSmoothingEnabled' in this.drawingContext) {
2521+
this.drawingContext.imageSmoothingEnabled = false;
2522+
} else if ('mozImageSmoothingEnabled' in this.drawingContext) {
2523+
this.drawingContext.mozImageSmoothingEnabled = false;
2524+
} else if ('webkitImageSmoothingEnabled' in this.drawingContext) {
2525+
this.drawingContext.webkitImageSmoothingEnabled = false;
2526+
} else if ('msImageSmoothingEnabled' in this.drawingContext) {
2527+
this.drawingContext.msImageSmoothingEnabled = false;
2528+
}
25222529
return this;
25232530
};
25242531
p5.Renderer2D.prototype.smooth = function () {
2525-
this.drawingContext.mozImageSmoothingEnabled = true;
2526-
this.drawingContext.webkitImageSmoothingEnabled = true;
2532+
if ('imageSmoothingEnabled' in this.drawingContext) {
2533+
this.drawingContext.imageSmoothingEnabled = true;
2534+
} else if ('mozImageSmoothingEnabled' in this.drawingContext) {
2535+
this.drawingContext.mozImageSmoothingEnabled = true;
2536+
} else if ('webkitImageSmoothingEnabled' in this.drawingContext) {
2537+
this.drawingContext.webkitImageSmoothingEnabled = true;
2538+
} else if ('msImageSmoothingEnabled' in this.drawingContext) {
2539+
this.drawingContext.msImageSmoothingEnabled = true;
2540+
}
25272541
return this;
25282542
};
25292543
p5.Renderer2D.prototype.strokeCap = function (cap) {

0 commit comments

Comments
 (0)