// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Uniform fit in display box // Not compiled or tested in-world // Setup: Set BOX dimensions. Use nonphysical child or unlinked prim; touch previews/restores. // Stop / restore: Owner-touch again to restore the startup snapshot before removal or reset, unless setup describes a different cycle. Do not relink during a preview. // Notes: Use a spare modifiable build. Saved state lives only in script memory. Not a whole-linkset resizer. Checks 0.01–64 meter dimensions; grids may impose other limits. // License: see LICENSE in this distribution. // Original Incoprea. MIT. Not compiled or tested in-world. integer preview; vector BOX=<1.0,1.0,1.0>; vector home; default { state_entry() { home=llGetScale(); } touch_start(integer n) { if(llDetectedKey(0)!=llGetOwner())return; if(llGetStatus(STATUS_PHYSICS)||BOX.x<=0.0||BOX.y<=0.0||BOX.z<=0.0)return; preview=!preview; if(preview) { float factor=BOX.x/home.x; if(BOX.y/home.y64.0||size.y>64.0||size.z>64.0) { preview=FALSE; return; } llSetScale(size); } else { llSetScale(home); } } }