Repository navigation
Changed
- BREAKING — raised the swift-design-system pin to 4.0.0, swift-latex-view to 0.5.0, and
swift-visual-testing to 3.0.0. DesignSystem types appear in this package's public API, so its
major becomes this one's. - Every dark reference image is re-recorded, because the old ones were the defect.
swift-visual-testing hardcoded a lightUITraitCollectioninto every device config, so a dark
capture was drawn over a light ground — and for a text view, which paints no background of its
own, that ground is the whole image. All 69 committed dark references measured a light mean
pixel; none does now. 77 images changed in total: 65 dark, plus 12 light that had drifted and
were passing underperceptualPrecision: 0.98.
Fixed
-
Display math rendered as a correctly sized, completely transparent bitmap.
ImageRenderer
draws only what SwiftUI draws, andLaTeXView's display body wraps the formula in a horizontal
ScrollViewso wide math can scroll — a platform-backed view, whichImageRendererlays out and
then leaves empty. The sameTextrenders with ink on its own and with none inside a
ScrollView. Every display formula therefore reserved its line height and drew nothing, which is
whylatex-display.dark.pngwas blank. Both modes now rasterize through the inline body, and
display style — limits above and below the operator, full-size fractions — is asked of the
typesetting engine directly with\displaystyle. Source the engine cannot parse is left alone,
sinceLaTeXViewfalls back to drawing the source it was given and prefixing it would put
\displaystylein front of the text the reader sees. -
MarkdownTextViewFactory.setDecorationPalette(_:on:)took aUITextViewand silently did
nothing when handed anything that was not aMarkdownTextView— no error, no log, just code
blocks with no background and no way for the caller to find out. It takes the concrete type now,
so the mistake is a compile error. -
Code block backgrounds, thematic breaks, table row separators, and block quote bars now follow
the appearance the document is drawn in.MarkdownDecorationPaletteturned the theme's colors
intoCGColorwhen it was built, which is inmakeUIView/updateUIView, where the current
trait collection is not the text view's. ACGColoris a concrete color, so a dynamic
UIColorasked for one there resolved light and stayed light: the body text followed the user
into dark mode and every decoration kept its light color. In the package's own dark-appearance
snapshots the quote bar, the rules, and the table separators all measured rgb(208,208,210) —
the same value as in light — while the text beside them measured rgb(243,243,249). An aside's
tinted bar was already right, because that color is read from the text storage inside
draw(at:in:); the palette default beside it was not.The palette now carries
UIColor/NSColor, and the color becomes aCGColorinside the
drawing call. On iOS the code block background is aCAShapeLayerfill, which can only hold a
concrete color, so it is resolved against the view's own trait collection and repainted when a
trait that decides how a color resolves changes.