compiling. interpreting was too slow
This commit is contained in:
parent
6edf592637
commit
2cd5a609bb
8 changed files with 650 additions and 21 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue