Autotiles are a new asset type with a tab that shows every tile of the floor (2x3) or wall (2x2) block and an animated sample pattern (#118)
game-maker / gate (push) Successful in 1m50s
game-maker / suite (push) Successful in 5m59s

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
adminandClaude Opus 5 committed 2026-09-17 21:35:29 +02:00
1 parent c17b2b5426
commit 1a9f07c4ac
24 files changed
+1797 -18

No files matched your search

+12 -3
View File
@@ -23,9 +23,18 @@ export interface GraphView {
zoom: number;
}
/** The view after zooming by `factor` about a screen point, which keeps the graph point under it. */
export function zoomedAbout(view: GraphView, at: Point, factor: number): GraphView {
const zoom = clamp(view.zoom * factor, ZOOM_LIMITS.min, ZOOM_LIMITS.max);
/**
* The view after zooming by `factor` about a screen point, which keeps the graph point under it.
* `limits` are the graph's own unless a surface with other content says otherwise – the autotile
* board shows 48 px tiles, which one wants to come closer to than a node graph.
*/
export function zoomedAbout(
view: GraphView,
at: Point,
factor: number,
limits: { min: number; max: number } = ZOOM_LIMITS,
): GraphView {
const zoom = clamp(view.zoom * factor, limits.min, limits.max);
const graphX = (at.x - view.pan.x) / view.zoom;
const graphY = (at.y - view.pan.y) / view.zoom;
return { pan: { x: at.x - graphX * zoom, y: at.y - graphY * zoom }, zoom };