RendererAdapter
Defined in: RendererAdapter.ts:13
Cross-package contract for “something that owns a canvas and can map canvas-relative CSS pixels into virtual-space pixels”.
Implemented by @yagejs/renderer’s RendererPlugin and consumed by
@yagejs/input for pointer-event targeting and coordinate mapping under
responsive fit. Foreign renderers can implement this interface and register
under RendererAdapterKey to integrate with the input plugin without
importing @yagejs/renderer.
Properties
Section titled “Properties”canvas
Section titled “canvas”
readonlycanvas:HTMLCanvasElement
Defined in: RendererAdapter.ts:14
Methods
Section titled “Methods”canvasToVirtual()?
Section titled “canvasToVirtual()?”
optionalcanvasToVirtual(x,y):object
Defined in: RendererAdapter.ts:20
Convert CSS pixels relative to the canvas into virtual-space pixels. Optional — when absent, consumers fall back to raw CSS pixels (correct only when canvas CSS size equals virtual size).
Parameters
Section titled “Parameters”number
number
Returns
Section titled “Returns”object
x:
number
y:
number