Skip to content

Conversation

@jserv
Copy link
Contributor

@jserv jserv commented Oct 20, 2025

The original code was functionally correct but semantically confusing. The delta (sdx, sdy) was calculated relative to dst_x/dst_y but applied to left/top in the rendering loop, which obscured the intent.


Summary by cubic

Clarified source/mask coordinate handling during clipping in _twin_composite_simple to make the 1:1 pixel mapping explicit. No functional changes; removes ambiguity and an outdated FIXME.

  • Refactors
    • Adjust src_x/src_y and msk_x/msk_y by (left - dst_x, top - dst_y) after clipping.
    • Compute sdx/sdy and mdx/mdy relative to left/top instead of dst_x/dst_y.
    • Added explanatory comments and removed the stale “source clipping is busted” FIXME.

The original code was functionally correct but semantically confusing.
The delta (sdx, sdy) was calculated relative to dst_x/dst_y but applied
to left/top in the rendering loop, which obscured the intent.
Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 1 file

@jserv jserv merged commit 8789d45 into main Oct 20, 2025
9 checks passed
@jserv jserv deleted the source-clipping branch October 20, 2025 01:25
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