Skip to content

Fix model fit math - #158

Merged
cabanier merged 4 commits into
immersive-web:mainfrom
cabanier:fix-model-fit-math
Oct 14, 2026
Merged

cabanier merged 4 commits into
immersive-web:mainfrom
cabanier:fix-model-fit-math

Conversation

@cabanier

@cabanier cabanier commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

Address #155 and clears up other fitting behavior


Preview | Diff

@cabanier
cabanier force-pushed the fix-model-fit-math branch 2 times, most recently from 9f7fc43 to a2e2248 Compare October 13, 2026 19:00
Define metric model bounds and CSS-derived element-space meters, including resource-unit normalization, CSS pixel conversion, and zoom/DPR semantics. Correct initial and orbit fitting scale ratios, centering, and depth clearance.

Fixes immersive-web#155.
Define automatic refitting after layout-size changes, preserving rotation
and leaving script-assigned transforms unchanged. Reuse stored resource
bounds without restarting or seeking animations, and specify how stage-mode
changes and new resource loads re-enable automatic fitting.

Reference CSS Values and Units and CSSOM View for CSS-derived meters,
page zoom, visual viewport scaling, and devicePixelRatio.

Remove displayed Issues 6 and 7 (GitHub immersive-web#1 and immersive-web#5) and regenerate
index.html from the Bikeshed source.

Validation: bikeshed --die-on=everything spec index.bs index.html;
git diff --check.
Align the fitting text with the width and height content-attribute definitions merged in immersive-web#159. Use the element's actual laid-out content box for initial fitting, and explicitly distinguish used CSS dimensions from the desired dimensions specified by the attributes. Preserve the existing resize trigger and zero-size handling; leave the deferred IDL and general CSS sizing work out of this PR.
Reference CSS Box Model 3, CSS Cascading 5, CSS Sizing 3, and
Geometry Interfaces 1 for content-box dimensions, used values,
sizing properties, and point/matrix operations.

Flag the proposed one-meter fallback for formats without declared
or default length units as needing further discussion, using a
native Bikeshed issue linked to immersive-web#155.

Keep the fitting arithmetic and width/height attribute definitions
unchanged. Strict Bikeshed validation passes.
@cabanier cabanier mentioned this pull request Oct 14, 2026

@AdaRoseCannon AdaRoseCannon left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you this is really well done and it matches the current behaviour.

@cabanier
cabanier merged commit 165f495 into immersive-web:main Oct 14, 2026
3 checks passed
@cabanier
cabanier deleted the fix-model-fit-math branch October 14, 2026 16:54
github-actions Bot added a commit that referenced this pull request Oct 14, 2026
SHA: 165f495
Reason: push, by cabanier

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants