Skip to content

Commit 9053dd4

Browse files
committed
fix bg, use strict
1 parent 011d35c commit 9053dd4

4 files changed

Lines changed: 6 additions & 2 deletions

File tree

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@
55
"repository": {
66
"type": "git",
77
"url": "git+https://github.com/LingDong-/q5xjs.git"
8-
}
8+
},
9+
"main": "q5.js"
910
}

q5.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
function Q5(scope){
2+
"use strict";
23
return new graphics(scope);
34
function graphics(scope){let $ = (scope == "global" ? window : this);
45
$.canvas = document.createElement("canvas");
@@ -827,6 +828,7 @@ function Q5(scope){
827828
}
828829
ctx.save();
829830
ctx.resetTransform();
831+
ctx.scale($._pixelDensity,$._pixelDensity);
830832
if (typeof arguments[0] == "string"){
831833
ctx.fillStyle = arguments[0];
832834
}else{

q5.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2609,6 +2609,7 @@ text(lines, 70, 25);
26092609
/*~~~ https://p5js.org/reference/#/p5/textSize ~~~*/
26102610

26112611
fill(0);
2612+
noStroke();
26122613
textSize(12);
26132614
text('Font Size 12', 10, 30);
26142615
textSize(14);

0 commit comments

Comments
 (0)