Skip to content

Commit e100783

Browse files
committed
fix label length calculation
cherry-picked from develop for 2.35.1
1 parent df5e576 commit e100783

File tree

6 files changed

+16
-5
lines changed

6 files changed

+16
-5
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,15 @@ _Breaking developer changes, which may affect downstream projects or sites that
3535
[@xxxx]: https://github.com/xxxx
3636
-->
3737

38+
39+
# v2.35.1
40+
##### 2025-07-14
41+
42+
* Fix rendering of line labels that were sometimes cut off at the ends, regression introduced in v2.35.0 ([#11123])
43+
44+
[#11123]: https://github.com/openstreetmap/iD/issues/11123
45+
46+
3847
# v2.35.0
3948
##### 2025-07-14
4049

dist/iD.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58320,6 +58320,7 @@ Please report this to https://github.com/markedjs/marked.`, e3) {
5832058320
}
5832158321
const elem = document.createElementNS("http://www.w3.org/2000/svg", "text");
5832258322
elem.style.fontSize = `${size}px`;
58323+
elem.style.fontWeight = "bold";
5832358324
elem.textContent = text;
5832458325
container.appendChild(elem);
5832558326
c2[text] = elem.getComputedTextLength();

dist/iD.js.map

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/iD.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/iD.min.js.map

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

modules/svg/labels.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -772,6 +772,7 @@ export function textWidth(text, size, container) {
772772
}
773773
const elem = document.createElementNS('http://www.w3.org/2000/svg', 'text');
774774
elem.style.fontSize = `${size}px`;
775+
elem.style.fontWeight = 'bold';
775776
elem.textContent = text;
776777
container.appendChild(elem);
777778
c[text] = elem.getComputedTextLength();

0 commit comments

Comments
 (0)