func (c *Canvas) InitDom(ctx context.Context, wg *sync.WaitGroup) {
	funcs := c.createEventFuncs()
	jsFuncs := make(map[string]js.Func, len(funcs))
	options := map[string]interface{}{
		"passive": false,
	}
	for fnName, fn := range funcs {
		jsFunc := c.dom.NewJsEventFunc(fn)
		c.element.Call("addEventListener", fnName, jsFunc, options)
		jsFuncs[fnName] = jsFunc
	}
	wg.Add(1)
	go c.dom.ReleaseJsFuncsOnDone(ctx, wg, jsFuncs)
}
// InitDom registers canvas dom functions by adding an event listeners to the canvas element.
InitDom registers canvas dom functions by adding an event listeners to the canvas element.
// InitDom registers canvas dom functions by adding an event listeners to the canvas element .
func (c *Canvas) InitDom(ctx context.Context, wg *sync.WaitGroup) {
	funcs := c.createEventFuncs()
	jsFuncs := make(map[string]js.Func, len(funcs))
	options := map[string]interface{}{
		"passive": false,
	}
	for fnName, fn := range funcs {
		jsFunc := c.dom.NewJsEventFunc(fn)
		c.element.Call("addEventListener", fnName, jsFunc, options)
		jsFuncs[fnName] = jsFunc
	}
	wg.Add(1)
	go c.dom.ReleaseJsFuncsOnDone(ctx, wg, jsFuncs)
}
func ( c * Canvas ) InitDom ( ctx context . Context , wg * sync . WaitGroup ) { funcs := c . createEventFuncs ( ) jsFuncs := make ( map [ string ] js . Func , len ( funcs ) ) options := map [ string ] interface { } { " " : false , } for fnName , fn := range funcs { jsFunc := c . dom . NewJsEventFunc ( fn ) c . element . Call ( " " , fnName , jsFunc , options ) jsFuncs [ fnName ] = jsFunc } wg . Add ( 1 ) go c . dom . ReleaseJsFuncsOnDone ( ctx , wg , jsFuncs ) }
InitDom registers canvas dom functions by adding an event listeners to the canvas element.
InitDom registers canvas dom functions by adding an event listeners to the canvas element .