compiling. interpreting was too slow

This commit is contained in:
Dustin Swan 2026-02-08 20:02:06 -07:00
parent 6edf592637
commit 2cd5a609bb
No known key found for this signature in database
GPG key ID: 30D46587E2100467
8 changed files with 650 additions and 21 deletions

View file

@ -31,8 +31,7 @@ function renderUI(ui: UIValue, ctx: CanvasRenderingContext2D, x: number, y: numb
if (ui.radius && ui.radius > 0) {
const r = Math.min(ui.radius, ui.w / 2, ui.h / 2);
const inset = ui.strokeWidth ? ui.strokeWidth / 2 : 0;
// TODO
// const inset = ui.strokeWidth ? ui.strokeWidth / 2 : 0; TODO
ctx.beginPath();
ctx.moveTo(x + r, y);
@ -201,7 +200,7 @@ export function measure(ui: UIValue): { width: number, height: number } {
}
}
export function hitTest(x: number, y: number): { event: Value, relativeX: number, relativeY: number } | null {
export function hitTest(x: number, y: number): { event: any, relativeX: number, relativeY: number } | null {
for (const region of clickRegions) {
if (x >= region.x && x < region.x + region.width &&
y >= region.y && y < region.y + region.height) {