Repository navigation
fix(timeline): unify dashed border stripe coordinates to screen pixels - #949
Merged
Merged
Conversation
Previously, the fragment shader added leftEdgeTimeMS (milliseconds) directly to posAlongBorder (pixels) to compute the dashed border pattern for revisions. Because of this dimensional mismatch, zooming in or out caused the phase of the pattern to spin rapidly relative to pixelsPerMs, producing intense stroboscopic flickering and moire artifacts across rows. Replace leftEdgeTimeMS with revisionClippedOffsetPx in pixels, and compute posAlongBorder using screen pixel coordinates for both horizontal and vertical borders.
kyasbal
requested review from
K53,
RyuSA,
jyane,
kkuchima and
renamoo
as code owners
September 3, 2026 03:57
Contributor
There was a problem hiding this comment.
Code Review
This pull request refactors the revision border stripe pattern calculation in the GLSL shaders, replacing the timestamp-based leftEdgeTimeMS with a pixel-offset-based revisionClippedOffsetPx. Feedback points out a potential precision loss issue in revision.vertex.glsl when a revision starts far to the left of the viewport, which can cause rendering artifacts. Applying a modulo operation with the border stripe pitch in the vertex shader is recommended to keep the offset value small and maintain float precision.
…er to prevent float precision loss
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.
Summary
Fixes a unit inconsistency in revision dashed border rendering where milliseconds (time) were directly added to screen pixels (space).
Root Cause
In
revision.color-fragment.glsl,borderStripePatternpreviously computed:leftEdgeTimeMSwas passed from the vertex shader in milliseconds (time difference fromvs.leftEdgeTime).posAlongBorderwas computed in screen pixels (uv * revisionScreenSize).vs.pixelsPerMschanges, causing the phase offsetleftEdgeTimeMS mod pitchto spin violently relative to zoom level. This produced severe stroboscopic flickering and moire artifacts across rows.Solution
revision.vertex.glsl: ReplacedleftEdgeTimeMSwithrevisionClippedOffsetPx(screen pixel offset for revisions that start outside the viewport and are clamped byminTime). For unclipped revisions, this is0.0.revision.color-fragment.glsl: ReplacedleftEdgeTimeMS + posAlongBorderwithmix(revisionClippedOffsetPx + revisionRelativeUV.x, revisionRelativeUV.y, isVerticalEdge). Dashes now run along pure screen pixel units for both horizontal and vertical edges.revision.hittest-fragment.glsl: Updated the unused input variable declaration to match the vertex shader output.Test Plan
npx ng test --include src/app/timeline/components/canvas/glsl-function-tester.spec.ts --browsers ChromeHeadlessNoSandbox --watch=false(10/10 passed)make test-web(1088/1088 passed)make pre-commit(all linters and formatters passed cleanly)