-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: turn off diagnostic in uniform control flow #6
- Loading branch information
Showing
10 changed files
with
229 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import { Canvas, Circle, Ellipse, Rect } from '../src'; | ||
import { Canvas, Circle } from '../src'; | ||
|
||
const $canvas = document.getElementById('canvas') as HTMLCanvasElement; | ||
const resize = (width: number, height: number) => { | ||
|
@@ -14,7 +14,7 @@ resize(window.innerWidth, window.innerHeight); | |
|
||
const canvas = await new Canvas({ | ||
canvas: $canvas, | ||
// renderer: 'webgpu', | ||
renderer: 'webgpu', | ||
shaderCompilerPath: | ||
'https://unpkg.com/@antv/[email protected]/dist/pkg/glsl_wgsl_compiler_bg.wasm', | ||
}).initialized; | ||
|
@@ -38,65 +38,6 @@ for (let i = 0; i < 1; i++) { | |
}); | ||
canvas.appendChild(circle); | ||
|
||
const ellipse = new Ellipse({ | ||
// cx: Math.random() * 1000, | ||
// cy: Math.random() * 1000, | ||
// rx: Math.random() * 20, | ||
// ry: Math.random() * 20, | ||
cx: 100, | ||
cy: 300, | ||
rx: 50, | ||
ry: 100, | ||
stroke: 'black', | ||
// strokeWidth: 20, | ||
// strokeOpacity: 0.5, | ||
fillOpacity: 0.5, | ||
fill: 'red', | ||
}); | ||
canvas.appendChild(ellipse); | ||
|
||
const rect = new Rect({ | ||
x: 0, | ||
y: 0, | ||
width: 400, | ||
height: 100, | ||
fill: 'red', | ||
// fillOpacity: 0.5, | ||
// strokeWidth: 10, | ||
// stroke: 'black', | ||
// strokeOpacity: 0.5, | ||
cornerRadius: 50, | ||
batchable: false, | ||
dropShadowColor: 'black', | ||
dropShadowOffsetX: 10, | ||
dropShadowOffsetY: 10, | ||
dropShadowBlurRadius: 10, | ||
}); | ||
canvas.appendChild(rect); | ||
|
||
const rect2 = new Rect({ | ||
x: 50, | ||
y: 50, | ||
width: 400, | ||
height: 100, | ||
fill: 'red', | ||
// fillOpacity: 0.5, | ||
// strokeWidth: 10, | ||
// stroke: 'black', | ||
// strokeOpacity: 0.5, | ||
// batchable: false, | ||
cornerRadius: 50, | ||
// dropShadowColor: 'black', | ||
// dropShadowOffsetX: 10, | ||
// dropShadowOffsetY: 10, | ||
// dropShadowBlurRadius: 10, | ||
innerShadowColor: 'blue', | ||
innerShadowOffsetX: 10, | ||
innerShadowOffsetY: 10, | ||
innerShadowBlurRadius: 10, | ||
}); | ||
canvas.appendChild(rect2); | ||
|
||
// circle.addEventListener('pointerenter', () => { | ||
// circle.fill = 'red'; | ||
// }); | ||
|
@@ -105,33 +46,6 @@ for (let i = 0; i < 1; i++) { | |
// }); | ||
} | ||
|
||
// for (let i = 0; i < 100; i++) { | ||
// const fill = `rgb(${Math.floor(Math.random() * 255)},${Math.floor( | ||
// Math.random() * 255, | ||
// )},${Math.floor(Math.random() * 255)})`; | ||
// const rect = new Rect({ | ||
// x: Math.random() * 1000, | ||
// y: Math.random() * 1000, | ||
// fill, | ||
// batchable: false, | ||
// dropShadowColor: 'black', | ||
// dropShadowOffsetX: Math.random() * 5, | ||
// dropShadowOffsetY: Math.random() * 5, | ||
// dropShadowBlurRadius: Math.random() * 10, | ||
// }); | ||
// rect.width = Math.random() * 40; | ||
// rect.height = Math.random() * 40; | ||
// rect.cornerRadius = Math.min(rect.width / 2, rect.height / 2); | ||
// canvas.appendChild(rect); | ||
|
||
// rect.addEventListener('pointerenter', () => { | ||
// rect.fill = 'red'; | ||
// }); | ||
// rect.addEventListener('pointerleave', () => { | ||
// rect.fill = fill; | ||
// }); | ||
// } | ||
|
||
const animate = () => { | ||
canvas.render(); | ||
requestAnimationFrame(animate); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.