Repository navigation
fix(editor): place node text in Firefox where Chrome places it - #463
Merged
Merged
Conversation
The mind map nudges each node's text up or down by a fraction of the font size, taken from a table per browser and operating system that was measured years ago. Current Firefox lays out the text like Chrome, but still used its own outdated values: on Linux the text sat about a sixth of a line too high, and on Windows text in Arial or Times New Roman sat a few pixels too high. Firefox now uses Chrome's values, so text is placed the same in both browsers. Exports to PNG, SVG and PDF reuse the same text and follow along. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
1 task done
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.
In Firefox, the text of mind map nodes sat too high in its box. This places it exactly where Chrome does. Based on the report in #259 (thanks @stephancordes); the fix is different from the one there.
Cause. kityminder-core nudges each node's text up or down by a fraction of the font size, taken from a table per browser, operating system and font that was measured around 2014 (
FONT_ADJUSTinvendor/kityminder-core). Current Firefox lays out the text (dominant-baseline: text-before-edge) the same way Chrome does, but still used its own old values:Fix. Firefox now uses Chrome's values: one condition in
kityminder.core.jsand the same inkityminder.core.min.js, which the editor loads.#259 instead dropped every
dyattribute on SVG text in Firefox. Node labels don't usedyin Firefox at all (only priority numbers and resource tags do, and those were already centred), so that would not have moved the labels.Checked by rendering the same map in headless Firefox 158 and Chrome on Windows, before and after: default font, Arial, Times New Roman, Comic Sans and Impact nodes, priorities and resource tags now sit at the same height in both browsers. With the platform reported as Linux, the patched Firefox output is identical to Chrome's. Still to check on a real Linux machine with Firefox, plus a quick look on macOS. Exports (PNG, SVG, PDF) reuse the same text, so they follow along.
The 0.1.x backport follows in a separate PR; the vendored file is identical there.
🤖 AI (if applicable)