You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Fix Follow link curve controls and inward-bend comment rendering - #317
Map Style renders two Follow link curve checkboxes with the same name and ID, so unchecking one can leave the option enabled. Separately, gentle inward bends can reject curved comments because letter spacing is measured on the arrow spine instead of the offset text baseline. The fallback then draws a straight rotated label that can cross the arrow.
Keep one checkbox and measure curved-comment placement along the offset text path, retaining kerning, endpoint alignment, nudge direction, and fallbacks for tight bends or reversed offset geometry. Reject invalid offset intervals only when the final label placement intersects them, after endpoint alignment and nudging; a remote tight bend or undefined U-turn tangent does not disable an otherwise valid label. Undefined tangents use one-sided normals only to construct locally bounded invalid intervals. Use binary distance lookup to avoid repeatedly scanning the sampled path. Refresh the curve-control gettext entries and the 2.0 issue changelog entry.
Validation:
Full PHP suite: 331 tests, 6,425 assertions passed.
Checked and unchecked form regressions reproduce the duplicate-control failure before the fix.
Regression reproduces the inward-bend failure using the reported link geometry, with both 9pt and 13pt TrueType fonts. A remote tight-bend regression fails before the interval fix and passes afterward, including reverse traversal and atomic fallback when nudged into the invalid tail. An exact remote-U-turn regression also fails before the fix and passes afterward, covering labels on both sides of the turn, reverse traversal and atomic fallback across the turn. Existing kerning, reverse-direction, endpoint, nudge, tight-bend and configuration round-trip checks pass.
Visually verified the corrected label on the reporting installation after a backed-up local deployment, without changing its map configuration.
PHP syntax, manifest, gettext-template and whitespace checks passed.
alcatron
changed the title
Fix duplicated Follow link curve control in Map Style
Fix Follow link curve controls and inward-bend comment rendering
Oct 17, 2026
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
A remote undefined tangent still forces valid labels to fall back to straight rendering.
No open issues 🎉
1 previously missed issue
In code that hasn't changed since last review
Handle zero tangents for comments near remote U-turns
lib/WeatherMapLink.class.php:403
The reversed-offset interval checks do not cover this earlier unconditional return. For an angled route (0,50) → (1000,50) → (800,50), the samples one pixel before and after the U-turn both lie at (999,50), making $norm zero. A short comment at 10% therefore falls back to straight rendering even though its placement is far from the turn. Handle undefined tangents locally while constructing the baseline, mark their affected intervals invalid, and reject only labels intersecting those intervals after alignment and nudging. Add a remote-U-turn regression and retain atomic fallback for labels crossing the turn.
Addressed the previously missed “Handle zero tangents for comments near remote U-turns” finding. The exact (0,50) → (1000,50) → (800,50) route now keeps a short label at 10% curved. Undefined tangent points receive one-sided construction normals, with nearby samples bounding the invalid region; adjacent intervals are marked invalid and checked only after final label alignment and nudging. Labels crossing the turn still fall back before any glyph is drawn.
The new regression failed before the fix and passes afterward. It also covers a label after the turn and reversed traversal. Full suite: 331 tests / 6,425 assertions passed. PHP syntax, manifest, gettext and whitespace checks passed.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Offset interpolation at sharp angled corners can place accepted comment baselines inside the arrow body.
No open issues 🎉
1 previously missed issue
In code that hasn't changed since last review
Corner normals bleed into straight sections, causing label overlap
lib/WeatherMapLink.class.php:436
On angled routes, calc_straight() supplies only 12 samples per leg. Interpolating these offset vertices spreads a corner's averaged normal over the adjacent straight section; the extra sampling above handles undefined tangents only, not ordinary sharp corners. For a one-way route (0,0) → (1000,0) → (1000,1000), width 20 and COMMENTPOS 48.5, the baseline starts around (980.9,-19.5) instead of (970,-24), inside the arrow body. A short label can pass all fallback guards there. Keep normal transitions local to sharp joins or construct proper offset joins, and add a regression using calc_straight() that checks clearance before the bend.
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
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.
Map Style renders two Follow link curve checkboxes with the same name and ID, so unchecking one can leave the option enabled. Separately, gentle inward bends can reject curved comments because letter spacing is measured on the arrow spine instead of the offset text baseline. The fallback then draws a straight rotated label that can cross the arrow.
Keep one checkbox and measure curved-comment placement along the offset text path, retaining kerning, endpoint alignment, nudge direction, and fallbacks for tight bends or reversed offset geometry. Reject invalid offset intervals only when the final label placement intersects them, after endpoint alignment and nudging; a remote tight bend or undefined U-turn tangent does not disable an otherwise valid label. Undefined tangents use one-sided normals only to construct locally bounded invalid intervals. Use binary distance lookup to avoid repeatedly scanning the sampled path. Refresh the curve-control gettext entries and the 2.0 issue changelog entry.
Validation: