Commit 79dc73a
committed
Fix: Rotate measurement text in SVG export
Previously, measurement text in SVG exports was always horizontal, regardless of the measurement line's orientation.
This change modifies the SvgDrawController.drawText method to:
- Utilize the `textDirection` vector (already calculated by MeasurementEntity) to determine the correct rotation angle for the text.
- Apply an SVG `transform="rotate(...)"` attribute to the <text> element.
- Ensure `text-anchor="middle"` is set when `textAlign` is `center`, to maintain proper centering after rotation.
This addresses issue #37 on GitHub, ensuring that measurement text is correctly aligned and centered with its corresponding line in SVG outputs.1 parent b18719f commit 79dc73a
1 file changed
+13
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
219 | 219 | | |
220 | 220 | | |
221 | 221 | | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
222 | 234 | | |
223 | 235 | | |
224 | | - | |
| 236 | + | |
225 | 237 | | |
226 | 238 | | |
227 | 239 | | |
| |||
0 commit comments