Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
L
lcc-shape
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
wangmingming
lcc-shape
Commits
2aeb6bb2
Commit
2aeb6bb2
authored
Aug 31, 2023
by
wang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
从数据库读取环境
parent
aec93674
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
HTMLCanvasElement-impl.js
jsdom/lib/jsdom/living/nodes/HTMLCanvasElement-impl.js
+9
-9
No files found.
jsdom/lib/jsdom/living/nodes/HTMLCanvasElement-impl.js
View file @
2aeb6bb2
...
@@ -3942,15 +3942,15 @@ class HTMLCanvasElementImpl extends HTMLElementImpl {
...
@@ -3942,15 +3942,15 @@ class HTMLCanvasElementImpl extends HTMLElementImpl {
// // ctx.clearRect(0, 0, 200, 200); // 擦除(0,0)位置大小为200x200的矩形,擦除的意思是把该区域变为透明
// // ctx.clearRect(0, 0, 200, 200); // 擦除(0,0)位置大小为200x200的矩形,擦除的意思是把该区域变为透明
// ctx.fillStyle = '#dddddd'; // 设置颜色
// ctx.fillStyle = '#dddddd'; // 设置颜色
// ctx.fillRect(parseInt(Math.random() * 20 + 20), parseInt(Math.random() * 20 + 20), parseInt(Math.random() * 20 + 20), parseInt(Math.random() * 20 + 20)); // 把(10,10)位置大小为130x130的矩形涂色
// ctx.fillRect(parseInt(Math.random() * 20 + 20), parseInt(Math.random() * 20 + 20), parseInt(Math.random() * 20 + 20), parseInt(Math.random() * 20 + 20)); // 把(10,10)位置大小为130x130的矩形涂色
if
(
this
.
width
>
100
&&
this
.
height
>
100
)
{
//
if (this.width > 100 && this.height > 100) {
for
(
let
i
=
0
;
i
<
randInt
(
10
,
20
);
i
++
)
{
//
for (let i = 0; i < randInt(10, 20); i++) {
let
ctx
=
canvas
.
getContext
(
'2d'
);
//
let ctx = canvas.getContext('2d');
//
let
color
=
Math
.
floor
(
Math
.
random
()
*
150
);
//
let color = Math.floor(Math.random() * 150);
ctx
.
fillStyle
=
"rgba("
+
color
+
","
+
color
+
","
+
color
+
",1)"
;
//
ctx.fillStyle = "rgba(" + color + "," + color + "," + color + ",1)";
ctx
.
fillRect
(
randInt
(
0
,
this
.
width
),
randInt
(
0
,
this
.
height
),
1
,
1
)
//
ctx.fillRect(randInt(0, this.width), randInt(0, this.height), 1, 1)
}
//
}
}
//
}
let
res
=
canvas
.
toDataURL
(...
args
);
let
res
=
canvas
.
toDataURL
(...
args
);
if
(
this
.
width
===
300
&&
this
.
height
===
150
)
{
if
(
this
.
width
===
300
&&
this
.
height
===
150
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment