FreeCAD / FreeCAD/FreeCAD

TechDraw: Dimension text spacing is unintentionally coupled to line width and alignment is based on text instead of dimension line

Open
#28,777 5 comments 1 reaction 0 assignees View on GitHub
Mod: TechDraw Type: Feature
Dominant language
C++
Stars
33.6k
Forks
6k
Avg merge
3d 15h
Merged PRs (30d)
196

Description

### Problem description

In TechDraw, the spacing between dimension text and the dimension line is affected by multiple parameters, including line width.

This creates an unintended coupling: changing line width also changes the apparent spacing between the line and the text. As a result, adjusting line width often requires additional manual adjustment of the line spacing parameter to maintain a visually acceptable result.

Additionally, when aligning multiple dimensions (e.g. snapping them to the same height), alignment appears to be based on the text position (roughly its vertical center), rather than the dimension line itself.

This leads to inconsistent results when dimensions use different text sizes: even if aligned, the dimension lines no longer lie on the same level.

In contrast, text size affects spacing in a consistent and visually appropriate way (likely via bounding box scaling), while line width introduces disproportionate changes.

Image

### Workbench affected?

TechDraw

### Steps to reproduce

1. Create a TechDraw page with at least two dimensions
2. Set a specific "Line spacing" value
3. Snap the dimensions to the same height
4. Change the text size of one dimension
5. Change the line width of one or both dimensions

Observe:
- The distance between the dimension line and the text changes with line width
- The dimensions remain "aligned", but their lines are no longer on the same level
- Alignment appears to follow text position rather than the dimension line

Additional observation:
- Changing text size scales spacing in a visually consistent way
- Changing line width alters spacing in a way that requires manual compensation

### Expected behavior

- Line spacing should be independent of line width
- Changing line width should not affect the distance between text and the dimension line
- Line spacing should primarily be influenced by text size (or text bounding box)

- Alignment of dimensions should be based on the dimension line, not the text position
- Dimensions aligned to the same height should have their lines on the same level, regardless of text size

### Actual behavior

- Line spacing is affected by line width
- Increasing line width increases the gap between the line and the text
- Users must manually readjust line spacing after changing line width

- Alignment is based on text position rather than the dimension line
- Dimensions with different text sizes do not align by their lines, even when snapped to the same height

### Suggested improvements

- Decouple line spacing from line width
- Define line spacing independently (e.g. absolute value or relative to text size only)
- Change alignment behavior to use the dimension line as the reference instead of text position

### Development version About Info (in Safe Mode)

```shell
OS: Windows 10 build 19045
Architecture: x86_64
Version: 1.2.0dev.20260324 (Git shallow)
Build date: 2026/03/24 17:14:33
Build type: Release
Branch: (HEAD detached at 1bc5980a7)
Hash: 1bc5980a7ff302a55c617181e774cd5cd2a9443a
Python 3.11.15, Qt 6.8.3, Coin 4.0.8, Vtk 9.3.1, boost 1_86, Eigen3 3.4.0, PySide 6.8.3
shiboken 6.8.3, xerces-c 3.3.0, IfcOpenShell 0.8.2, OCC 7.8.1
Locale: English/United States (en_US) [ OS: English/Europe (en_150) ]
Stylesheet/Theme/QtStyle: FreeCAD.qss/FreeCAD Light/
Navigation Style/Orbit Style/Rotation Mode: Blender/Rounded Arcball/Window center
Logical DPI/Physical DPI/Pixel Ratio: 96/93.6146/1
```

### Last known good version (optional)

```shell

```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.