Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb19a5b3

Browse files
authored
fix: earcut triangulation issues (#11559)
Fixes:#11526Updates the earcut library to the latest version.Adds a visual test to verify that the triangulation is working correctly.
1 parent6bf41ed commitb19a5b3

File tree

6 files changed

+55
-8
lines changed

6 files changed

+55
-8
lines changed

‎package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
"@types/earcut":"^3.0.0",
6868
"@webgpu/types":"^0.1.40",
6969
"@xmldom/xmldom":"^0.8.10",
70-
"earcut":"^3.0.1",
70+
"earcut":"^3.0.2",
7171
"eventemitter3":"^5.0.1",
7272
"gifuct-js":"^2.1.2",
7373
"ismobilejs":"^1.1.1",
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import{Graphics}from'~/scene';
2+
3+
importtype{TestScene}from'../../types';
4+
importtype{Container}from'~/scene';
5+
6+
exportconstscene:TestScene={
7+
it:'should render circles',
8+
create:async(scene:Container)=>
9+
{
10+
letyOffset=0;
11+
12+
functiondrawShape(step:number,color:string,closingPoint:boolean)
13+
{
14+
constshape=newGraphics();
15+
16+
shape.moveTo(0,200+yOffset);
17+
for(letx=0;x<=200;x+=step)
18+
{
19+
shape.lineTo(x,200+yOffset);
20+
}
21+
for(letx=200;x<=400;x+=step)
22+
{
23+
shape.lineTo(x,100+yOffset);
24+
}
25+
shape.lineTo(400,200+yOffset);
26+
if(closingPoint)
27+
{
28+
shape.lineTo(0,200+yOffset);
29+
}
30+
shape
31+
.closePath()
32+
.fill({
33+
color,
34+
alpha:1,
35+
})
36+
.stroke({
37+
color:'black',
38+
width:10,
39+
});
40+
shape.scale.set(0.25);
41+
scene.addChild(shape);
42+
yOffset+=150;
43+
}
44+
// Doesn't work
45+
drawShape(5,'red',false);
46+
},
47+
};
844 Bytes
Loading
844 Bytes
Loading
844 Bytes
Loading

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp