Skip to content

fix: prevent mask coverage gap during adjacent segment transitions#1631

Open
AdamJBurns wants to merge 2 commits intoCapSoftware:mainfrom
AdamJBurns:mask-transition-1619
Open

fix: prevent mask coverage gap during adjacent segment transitions#1631
AdamJBurns wants to merge 2 commits intoCapSoftware:mainfrom
AdamJBurns:mask-transition-1619

Conversation

@AdamJBurns
Copy link

@AdamJBurns AdamJBurns commented Feb 24, 2026

When two mask segments are directly adjacent (share a boundary) and a zoom is applied, the current interpolation logic can fade out/in at the shared edge. During the transition, opacity briefly drops at that boundary, exposing sensitive content.

All other behavior is unchanged: PreparedMask construction, clamping, feathering, and size handling remain identical.

Fixes: #1619

Greptile Summary

Prevents opacity gaps during adjacent mask segment transitions by detecting when segments share boundaries and skipping fade-in/fade-out at those points

  • Collects enabled segments upfront to enable index-based iteration
  • Checks for adjacent segments before and after current segment using time boundaries
  • Sets fade multipliers to 1.0 when adjacent segments detected, maintaining full opacity
  • Found minor threshold issue: using < instead of <= may miss segments exactly at fade_duration apart

Confidence Score: 4/5

  • Safe to merge with one minor threshold precision fix recommended
  • Core logic correctly detects adjacency and prevents fade gaps, but comparison operator should use <= instead of < to catch exact boundary matches at fade_duration distance
  • crates/rendering/src/mask.rs - fix adjacency threshold comparison operators on lines 93 and 98

Important Files Changed

Filename Overview
crates/rendering/src/mask.rs Added adjacency detection to prevent fade gaps at mask boundaries - logic is sound but has a minor threshold precision issue

Last reviewed commit: 1354425

(2/5) Greptile learns from your feedback when you react with thumbs up/down!

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

1 file reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

Prevents suppressing fades on segments that have an intentional gap.

Co-authored-by: Cursor <cursoragent@cursor.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.

Transition from one mask to another exposes sensitive information

1 participant