ensure single-line label when rendering across segments

This commit is contained in:
Luis Camacho
2022-05-22 17:41:52 +01:00
parent 5e2b9fb629
commit 94c8900883

View File

@@ -104,6 +104,9 @@ export function drawTextOnPath(
return result;
}
// rendering across line segments
text = text.replace(/\n/g, ' '); // ensure rendering in single-line as all calculations below don't handle multi-lines
for (let i = 0, ii = text.length; i < ii; ) {
advance();
let angle = Math.atan2(y2 - y1, x2 - x1);