Skip to main content

Module adjust

Module adjust 

Source
Expand description

Stroke-adjust hint application.

Mirrors SplashXPathAdjust and SplashXPath::strokeAdjust() from splash/SplashXPath.cc.

§What stroke adjustment does

PDF stroke adjustment snaps near-axis-aligned path segments to integer pixel boundaries so that adjacent stroked rectangles share a pixel edge rather than leaving a half-pixel gap. This is controlled by the PDF strokeAdjust graphics state parameter.

Each XPathAdjust describes three “snap windows” (around x0, xm, x1) with ±0.01 tolerance. Any transformed coordinate that falls strictly inside a window is replaced by the corresponding snapped target.

§Open-interval semantics

The snap windows are open intervals: a coordinate exactly at a boundary value (e.g. v == adj0 - 0.01) is not snapped. See stroke_adjust.

Structs§

XPathAdjust
An axis-aligned stroke-adjust hint, derived from a StrokeAdjustHint (see crate::path::stroke) after path transformation.

Functions§

stroke_adjust
Apply a stroke-adjust hint to a single point (x, y).