mirror of
https://github.com/vlang/v.git
synced 2025-09-13 22:42:26 +03:00
parent
0afa2f76c8
commit
041e90b2e2
8 changed files with 89 additions and 28 deletions
|
@ -197,7 +197,7 @@ const (
|
|||
amortization = 0.95
|
||||
)
|
||||
|
||||
fn get_webgl() (&JS.HTMLCanvasElement, JS.WebGLRenderingContext) {
|
||||
fn get_webgl() (JS.HTMLCanvasElement, JS.WebGLRenderingContext) {
|
||||
JS.console.log(dom.document)
|
||||
elem := dom.document.getElementById('myCanvas'.str) or { panic('cannot get canvas') }
|
||||
match elem {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import js.dom
|
||||
|
||||
fn get_canvas(elem JS.HTMLElement) &JS.HTMLCanvasElement {
|
||||
fn get_canvas(elem JS.HTMLElement) JS.HTMLCanvasElement {
|
||||
match elem {
|
||||
JS.HTMLCanvasElement {
|
||||
return elem
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue