Skip to content

fix(milkdrop): a still motion-vector stub points up, as in MilkDrop - #751

Merged
CaYatur merged 1 commit into
mainfrom
fix/milkdrop-mv-still-stub
Oct 13, 2026
Merged

CaYatur merged 1 commit into
mainfrom
fix/milkdrop-mv-still-stub

Conversation

@CaYatur

@CaYatur CaYatur commented Oct 13, 2026

Copy link
Copy Markdown
Owner

When a motion vector has no length at all (mv_l = 0, or nothing moves), MilkDrop draws a one-texel stub with dx = dy = min_len. MilkDrop's fy runs bottom-up, so the stub goes right and up; ours runs top-down and kept the sign, so it went right and down. Vectors with a real length were already correct.

  • src/visualizer/modes/milkdrop.js: ddy = -minLen in the zero-length branch.
  • tests/milkdrop-motion-vectors.test.js: a still field (mv_l = 0) draws stubs one texel right and one texel up. Fails without the fix (yukarı: 0.00104 / -0.00104).
  • CHANGELOG "Unreleased" entry; test count 3004 → 3005.

Found while checking our motion-vector code against MilkDrop's for #750.

Refs #560, #695

…560)

When a vector has no length at all (for example `mv_l = 0`, or a still
field), MilkDrop draws a one-texel stub with `dx = dy = min_len`
(milkdropfs.cpp, DrawMotionVectors). Its `fy` runs bottom-up, so the stub
goes right and UP. Our grid runs top-down and kept the same sign, so the
stub went right and down. Vectors with a real length were already right.

Found while checking the motion-vector code against MilkDrop's for #750.

Co-authored-by: caganturgut <271973834+caganturgut@users.noreply.github.com>
@CaYatur
CaYatur merged commit c88e6fc into main Oct 13, 2026
5 checks passed
@CaYatur
CaYatur deleted the fix/milkdrop-mv-still-stub branch October 13, 2026 17:17
@cayadraft

cayadraft Bot commented Oct 13, 2026

Copy link
Copy Markdown

@CaYatur

CaYaDraft — pull request

Summary
This pull request fixes a rendering bug in the MilkDrop mode where still motion vectors (zero length) incorrectly drew stubs downward instead of upward. The issue arose because the code kept the original sign for vertical movement while reversing the drawing order, causing the visual artifact to point down rather than up like the reference application.

Files

  • src/visualizer/modes/milkdrop.js: Corrected the vertical offset for zero-length motion vectors to draw upward.
  • tests/milkdrop-motion-vectors.test.js: Added a test case verifying that still fields render stubs one texel right and one texel up.
  • CHANGELOG.md, README.md, README.tr.md, ROADMAP.md: Updated documentation and changelog entries to reflect the fix and increased test count.

Note
Nothing blocking is visible from the text.


Stopping here. I will not merge, push, or change this pull request until you ask.

/caya explain describes the diff. /caya plan previews the next edit. /caya revise adds a commit.

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.

1 participant