Repository navigation
fix(background): rasterize the heropattern tile at its target scale - #251
Merged
LeadcodeDev merged 0 commit intoSep 22, 2026
Merged
Conversation
53 tasks
LeadcodeDev
force-pushed
the
fix/heropattern-colour-escape
branch
from
September 22, 2026 06:11
11ed92d to
14f8d7e
Compare
LeadcodeDev
force-pushed
the
fix/heropattern-rasterize-scale
branch
from
September 22, 2026 06:11
ae19875 to
578fe99
Compare
LeadcodeDev
force-pushed
the
fix/heropattern-colour-escape
branch
from
September 22, 2026 08:35
14f8d7e to
3163f12
Compare
LeadcodeDev
force-pushed
the
fix/heropattern-rasterize-scale
branch
2 times, most recently
from
September 22, 2026 08:45
b2934dc to
a07e8ad
Compare
LeadcodeDev
merged commit Sep 22, 2026
a07e8ad
into
fix/heropattern-colour-escape
2 of 3 checks passed
LeadcodeDev
force-pushed
the
fix/heropattern-colour-escape
branch
from
September 22, 2026 08:45
3163f12 to
c760058
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Severity Medium, category quality. Location:
crates/rustmotion/src/engine/render/background.rs:605Impact
tile_w = def.width * cfg.scaleis computed at line 581 and used only for the overscan margin; the pixmap at 605-606 is sized from the unscaleddef.width/def.heightand resvg renders withTransform::default()(identity). The magnification then happens on the raster, via the shader matrix, withSamplingOptions::default()— which I read in skia-safe-0.99.0/src/core/sampling_options.rs:70-80:filter: FilterMode::Nearest, mipmap: MipmapMode::None. Soheropatternwithscale: 4on a 1080p frame draws hard 4x4 pixel blocks from a 20x20 source raster, when the source is vector art that resvg could have rendered crisply at any size. The whole point of shipping 87 SVG patterns is lost above scale 1. It is also wasteful below 1: ascale: 0.25pattern is rasterized at full size and then point-sampled down, aliasing badly.Fix
Size the pixmap at the scaled tile (
(def.width * cfg.scale).ceil()x(def.height * cfg.scale).ceil(), clamped to a sane maximum) and passtiny_skia::Transform::from_scale(cfg.scale, cfg.scale)toresvg::render, then drop the shader matrix so the tile is used 1:1. At minimum, passSamplingOptions::new(FilterMode::Linear, MipmapMode::Linear)instead of the nearest-neighbour default.Evidence the audit read
Part of the September 2026 audit remediation chantier. Refs #220 (RM-22).