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)
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
c17b2b5426
commit
1a9f07c4ac
24 files changed
+1797
-18
No files matched your search
@@ -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 };
|
||||
|
||||
Reference in new issue
Block a user