Skip to content

Commit f6d13d1

Browse files
authored
fix frameanchor bottom (#1061)
* text with frameAnchor: bottom should be correctly aligned with the frame, not one line below closes #1043 * test fixed by #1062 * since the sum (strict window) ignores the first 6 days, feels nicer to ignore them from the domain as well.
1 parent aa4f690 commit f6d13d1

File tree

6 files changed

+186
-53
lines changed

6 files changed

+186
-53
lines changed

src/marks/text.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ function applyMultilineText(selection, {monospace, lineAnchor, lineHeight, lineW
140140
selection.each(function (i) {
141141
const lines = linesof(formatDefault(T[i]));
142142
const n = lines.length;
143-
const y = lineAnchor === "top" ? 0.71 : lineAnchor === "bottom" ? 1 - n : (164 - n * 100) / 200;
143+
const y = lineAnchor === "top" ? 0.71 : lineAnchor === "bottom" ? -0.29 - n : (164 - n * 100) / 200;
144144
if (n > 1) {
145145
for (let i = 0; i < n; ++i) {
146146
if (!lines[i]) continue;

test/output/penguinAnnotated.svg

+81
Loading

0 commit comments

Comments
 (0)