Skip to content

RenderContext: render zones inside a filter start at the filter texture's origin - #1376

Open
hoseyjoe wants to merge 1 commit into
HeapsIO:masterfrom
hoseyjoe:fix-filter-render-zone
Open

hoseyjoe wants to merge 1 commit into
HeapsIO:masterfrom
hoseyjoe:fix-filter-render-zone

Conversation

@hoseyjoe

@hoseyjoe hoseyjoe commented Oct 6, 2026

Copy link
Copy Markdown

The bottom of letters was being cut off.

Object.drawFilters pushes the filter texture with the (xMin, yMin) of its bounds as the target's start, but setRZ maps a render zone through the filter matrix (relative to the filtered object's origin, already in texture pixels) and then through the scene viewport. So inside a filter the zone is:

  • offset by (xMin, yMin): e.g. 2px up and left under a Blur/Glow with radius 1, since boundsExtend makes xMin/yMin negative
  • scaled a second time by the viewport when the scene is scaled (the filter matrix already includes viewportScale * resolutionScale when useScreenResolution is set)

Symptom: a single-line TextInput drawn inside any filtered parent has its descenders (g, p, y, j) clipped off, because its clipRenderZone of one lineHeight ends up a couple of pixels too high.

Fix: when inFilter, map the zone into the current target's pixels, using the start offset that pushTarget folded into viewX/viewY. Outside a filter nothing changes, and when the start is 0 and the viewport is unscaled the result is the same as before.

Tested on HashLink (SDL): descenders that were cut off now render in full.

🤖 Generated with Claude Code

…re's origin

Object.drawFilters pushes the filter texture with the (xMin, yMin) of its
bounds as the target's start, but setRZ mapped a zone through the filter
matrix (relative to the filtered object's origin, already in texture
pixels) and then through the scene viewport. The zone was therefore
offset by (xMin, yMin) - e.g. 2px up and left under a Blur/Glow with
radius 1 - and scaled a second time when the viewport is scaled.

Visible as a single-line TextInput, drawn inside any filtered parent,
having the descenders of its text clipped off.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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