Skip to content

Commit 3f349f9

Browse files
author
Lauren McCarthy
committed
updating devicePixelScaling() method to take optional number arg
1 parent dbd73e0 commit 3f349f9

File tree

3 files changed

+25
-5
lines changed

3 files changed

+25
-5
lines changed

lib/p5.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! p5.js v0.4.2 March 20, 2015 */
1+
/*! p5.js v0.4.2 March 23, 2015 */
22
(function (root, factory) {
33
if (typeof define === 'function' && define.amd)
44
define('p5', [], function () { return (root.returnExportsGlobal = factory());});
@@ -2244,7 +2244,11 @@ amdclean['environment'] = function (require, core, constants) {
22442244
};
22452245
p5.prototype.devicePixelScaling = function (val) {
22462246
if (val) {
2247-
this._pixelDensity = window.devicePixelRatio || 1;
2247+
if (typeof val === 'number') {
2248+
this._pixelDensity = val;
2249+
} else {
2250+
this._pixelDensity = window.devicePixelRatio || 1;
2251+
}
22482252
} else {
22492253
this._pixelDensity = 1;
22502254
}

0 commit comments

Comments
 (0)