Import the 2026-10-09 source release, Fastify/SQLite backend, restored source assets, and analytics-enabled server build. Replace files from the previous release while retaining the existing repository history. Make builds portable across Windows and Linux, configure local startup, normalize Windows static asset paths, and fix test fixture cleanup and file URL handling. Exclude local environment settings, databases, dependencies, validation output, and TypeScript build cache from version control. Validation: npm ci, static and server builds, 106 arrival tests, and actual local HTTP checks passed. The full suite passed 467 of 470 tests; three tests still require QA fixtures omitted from the supplied release, documented in README-서버실행.md.
26 lines
1.5 KiB
TypeScript
26 lines
1.5 KiB
TypeScript
import {fitWindowScale} from './BlenderWindowFrame';
|
|
|
|
export const PEEKING_DOOR_ASPECT=.74;
|
|
export interface MaskBounds {x:number;y:number;width:number;height:number}
|
|
/** Door geometry is independent of the uploaded photograph. The legacy photo aperture
|
|
* remains available for conservative foreground-detail clearance. The runtime
|
|
* corner camera follows the physical door dimensions. */
|
|
export function peekingLayout(viewAspect:number,photoAspect:number) {
|
|
const scale=fitWindowScale(viewAspect,PEEKING_DOOR_ASPECT)*.82;
|
|
const legacy=fitWindowScale(viewAspect,photoAspect)*.82;
|
|
const width=scale*PEEKING_DOOR_ASPECT*.8,height=scale*.8;
|
|
const cameraBounds:[number,number,number]=[legacy*photoAspect*.8,legacy*.8,.6];
|
|
return {width,height,cameraBounds,clearanceScale:Math.min(width,height,...cameraBounds.slice(0,2))};
|
|
}
|
|
/** No pose synthesis: place the actual selected silhouette. Default crops the
|
|
* lower edge behind the sill; manual XY remains available even at scale 1. */
|
|
export function placePeekingDog(layout:{width:number;height:number},aspect:number,bounds:MaskBounds,z:number,zoom:number,panX:number,panY:number) {
|
|
const h=layout.height,w=layout.width;
|
|
const objectHeight=Math.min(.48*h,.43*w/(Math.max(.01,bounds.width)*aspect/Math.max(.01,bounds.height)))*zoom;
|
|
const height=objectHeight/Math.max(.01,bounds.height),width=height*aspect;
|
|
const centerX=.24*w+panX*.35*w,top=-.56*h+objectHeight+panY*.35*h;
|
|
const x=centerX-(bounds.x+bounds.width/2-.5)*width;
|
|
const y=top-(.5-bounds.y)*height;
|
|
return {x,y,z,width,height};
|
|
}
|