Fix the rendering faults on the Crust and Plate Motion screens - #8
Merged
Conversation
Plate Motion was drawing four things wrong, all visible on first load: - **The sea was never painted.** `paintMantle` filled the section from sea level down, over the seawater rectangle drawn just before it, so `showSeawaterProperty` was a no-op and every ocean floor had sky above it instead of water. The mantle is now clipped to below the ground — the merge of both plates' `crustTop` polylines — which also lets a collision belt standing above the waterline keep mantle under it. - **The subducting plate drew as a bowtie.** `subductionGeometry` reversed the down-going plate's `crustTop` but not its two base lines. `fillBand` closes a band by walking the top forward and the base back, so the mismatched direction folded the plate into a self-crossing X spanning half the section. All three polylines now run the same way, and `PlateGeometry.test.ts` asserts that invariant for every pairing, motion and time — it fails on the old code. - **Density mode, the default, showed no plates and no slab.** The lithospheric mantle and the descending slab were both painted at the asthenosphere's `MANTLE_DENSITY_KG_M3`, so each plate appeared to be crust floating on nothing. They are the same rock at different temperatures, and the density difference is the whole reason a cooled plate can sink, so they now get their own values. - **A spent slab smeared along the floor.** `CrossSectionScale.y` clamps, so a slab past the bottom of the view was drawn as a horizontal streak along the bottom edge with its arrow-heads strung out sideways. The centreline is trimmed at the first point below the section. Also on that screen, the crust chooser overlapped the cross-section: the section's top was inset by a hardcoded 62 px against a panel that is taller than that. It is measured now, since the height depends on the font and on the length of the localized crust names. On Crust, a block whose surface is below sea level had its label placed in the few pixels of water above it, landing on the sea-level line and its caption — which is exactly where the user's own block sits at the default thickness. Submarine blocks now carry the label just inside the rock; blocks standing above the water keep theirs in the sky. `columnAt` also treats the outermost edge of the last block as inside it, so the right-hand edge of the viewport no longer reads as open mantle to the painter and the probe. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JZ1JDB8VPtJPHoiu7C33kQ
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Plate Motion was drawing four things wrong, all visible on first load:
The sea was never painted.
paintMantlefilled the section from sealevel down, over the seawater rectangle drawn just before it, so
showSeawaterPropertywas a no-op and every ocean floor had sky aboveit instead of water. The mantle is now clipped to below the ground —
the merge of both plates'
crustToppolylines — which also lets acollision belt standing above the waterline keep mantle under it.
The subducting plate drew as a bowtie.
subductionGeometryreversed the down-going plate's
crustTopbut not its two base lines.fillBandcloses a band by walking the top forward and the base back,so the mismatched direction folded the plate into a self-crossing X
spanning half the section. All three polylines now run the same way,
and
PlateGeometry.test.tsasserts that invariant for every pairing,motion and time — it fails on the old code.
Density mode, the default, showed no plates and no slab. The
lithospheric mantle and the descending slab were both painted at the
asthenosphere's
MANTLE_DENSITY_KG_M3, so each plate appeared to becrust floating on nothing. They are the same rock at different
temperatures, and the density difference is the whole reason a cooled
plate can sink, so they now get their own values.
A spent slab smeared along the floor.
CrossSectionScale.yclamps,so a slab past the bottom of the view was drawn as a horizontal streak
along the bottom edge with its arrow-heads strung out sideways. The
centreline is trimmed at the first point below the section.
Also on that screen, the crust chooser overlapped the cross-section: the
section's top was inset by a hardcoded 62 px against a panel that is
taller than that. It is measured now, since the height depends on the
font and on the length of the localized crust names.
On Crust, a block whose surface is below sea level had its label placed
in the few pixels of water above it, landing on the sea-level line and
its caption — which is exactly where the user's own block sits at the
default thickness. Submarine blocks now carry the label just inside the
rock; blocks standing above the water keep theirs in the sky.
columnAtalso treats the outermost edge of the last block as inside it, so the
right-hand edge of the viewport no longer reads as open mantle to the
painter and the probe.
Co-Authored-By: Claude Opus 5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01JZ1JDB8VPtJPHoiu7C33kQ