Skip to content

Commit b192a01

Browse files
committed
move comment
1 parent 9dc8020 commit b192a01

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

src/marks/tip.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,10 +191,9 @@ export class Tip extends Mark {
191191
value = "";
192192
} else {
193193
const space = label || (!value && !swatch) ? " " : "";
194-
const text = clipper({monospace, lineWidth: lineWidth - widthof(label + space) / 100, textOverflow})(value);
195-
// value is truncated
196-
if (text !== value) title = value.trim();
197-
value = space + text;
194+
const clipped = clipper({monospace, lineWidth: lineWidth - widthof(label + space) / 100, textOverflow})(value);
195+
if (clipped !== value) title = value.trim(); // show untruncated value in title
196+
value = space + clipped;
198197
}
199198
const line = selection.append("tspan").attr("x", 0).attr("dy", `${lineHeight}em`).text("\u200b"); // zwsp for double-click
200199
if (label) line.append("tspan").attr("font-weight", "bold").text(label);

0 commit comments

Comments
 (0)