Skip to content

Commit

Permalink
fix bg, use strict
Browse files Browse the repository at this point in the history
  • Loading branch information
LingDong- committed Sep 21, 2020
1 parent 011d35c commit 9053dd4
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
"repository": {
"type": "git",
"url": "git+https://github.com/LingDong-/q5xjs.git"
}
},
"main": "q5.js"
}
2 changes: 2 additions & 0 deletions q5.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
function Q5(scope){
"use strict";
return new graphics(scope);
function graphics(scope){let $ = (scope == "global" ? window : this);
$.canvas = document.createElement("canvas");
Expand Down Expand Up @@ -827,6 +828,7 @@ function Q5(scope){
}
ctx.save();
ctx.resetTransform();
ctx.scale($._pixelDensity,$._pixelDensity);
if (typeof arguments[0] == "string"){
ctx.fillStyle = arguments[0];
}else{
Expand Down
2 changes: 1 addition & 1 deletion q5.min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -2609,6 +2609,7 @@ text(lines, 70, 25);
/*~~~ https://p5js.org/reference/#/p5/textSize ~~~*/

fill(0);
noStroke();
textSize(12);
text('Font Size 12', 10, 30);
textSize(14);
Expand Down

0 comments on commit 9053dd4

Please sign in to comment.