Skip to content

Fix LayoutResY when resampling with vertical borders - #729

Merged
arch1t3cht merged 1 commit into
TypesettingTools:masterfrom
CoffeeFlux:fix/resample-layoutres-vertical-border
Oct 8, 2026
Merged

arch1t3cht merged 1 commit into
TypesettingTools:masterfrom
CoffeeFlux:fix/resample-layoutres-vertical-border

Conversation

@CoffeeFlux

Copy link
Copy Markdown
Member

When adding or removing borders on a script that has a LayoutRes, the resampler computes the new LayoutResY as

new_lry = lry + std::round(lry * (margin[TOP] + margin[BOTTOM]) / double(source_x));

It should divide by source_y, since LayoutResY needs to grow by the same proportion as PlayResY when top and bottom margins are added. As written, LayoutResY comes out wrong whenever Add/Remove borders (or Manual) produces vertical margins on a non-square script. This was introduced in 9f98439. Horizontal-only margins are unaffected, since then both margins are 0.

I haven't built this branch on its own; the change is a single operand, and there are no unit tests covering src/resolution_resampler.cpp.

🤖 Generated with Claude Code

When adding or removing borders on a script that has a LayoutRes, the
new LayoutResY was scaled by the top and bottom margins relative to the
source width instead of the source height, giving the wrong LayoutResY
whenever the margins were vertical. Introduced in 9f98439.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@arch1t3cht
arch1t3cht merged commit 3a33801 into TypesettingTools:master Oct 8, 2026
6 checks passed
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