a million fixes

This commit is contained in:
Dustin Swan 2026-02-11 22:06:26 -07:00
parent b1696499e5
commit c294d7fd6a
No known key found for this signature in database
GPG key ID: 30D46587E2100467
12 changed files with 140 additions and 168 deletions

View file

@ -213,7 +213,9 @@ export function measure(ui: UIValue): { width: number, height: number } {
}
export function hitTest(x: number, y: number): { event: any, relativeX: number, relativeY: number } | null {
for (const region of clickRegions) {
for (let i = clickRegions.length - 1; i >= 0; i--) {
const region = clickRegions[i];
if (x >= region.x && x < region.x + region.width &&
y >= region.y && y < region.y + region.height) {
return {