Commit Graph

176 Commits

Author SHA1 Message Date
Benjamin Guest
4f56102978 TechDraw: Fix dimension alignment issue.
Fixes issue #19121 "dimension numbers placed lower than normal".

Problem:

QGCustomText has a new method `alignmentRect` which can optionally return a
`tightBoundingRect` instead of the regular `boundingRect`. The
`alignmentRect` is used for laying out the `QGIDatumLabel`, however
QGraphicsItemGroup's `childrenBoundingRect` use the childrens'
`boundingRect` and knows nothing of `alignmentRect`. The result is an
improperly sized label and frame and miss alignment. Additionally
`childrenBoundingRect` calculations includes hidden views, so even though
the `m_tolTextOver` and `m_tolTextUnder` are hidden they still affect
the bounding rect size.

Solution:

1. Implement new method `QGIDatumLabel::tightBoundingRect` this
   calculates the bounding rect using the subview's
   `aligmentRect` if there is text in the custom text.
2. Use `tightBoundingRect` in place of `boundingRect` to for the drawing of
   arrows and the exact dim frames.
3. This PR acknowledges that there are some edge case fonts that while not
   clipped may not interface perfectly with arrows and the exact dimension
   frame.
4. Fix vertical alignment of `m_tolTextOver` / `m_tolTextUnder`
5. Incorporate PR Review comments
2025-01-27 20:39:41 +01:00
WandererFan
dc25d51e80 [TD]Dimension font clipping (fix #11452) (#18771)
* [TD]separate alignment and rendering bounding rectangles

* [TD]use alignment rectangle (fix #11452)
2025-01-13 11:13:59 -06:00
Ladislav Michl
1e529bcc7d TechDraw: Ensure tolerance font size is > 0 2024-12-16 12:23:51 -05:00
luzpaz
a633be7342 Fix various typos
Found via codespell.
2024-11-15 20:18:46 +01:00
wandererfan
17e9f10ca7 [TD]throttle over aggressive dimension autocorrect 2024-10-14 17:45:53 +02:00
Benjamin Bræstrup Sayoc
66539741ac [TechDraw] Some refactoring of frame pen 2024-09-02 16:53:37 -04:00
Benjamin Bræstrup Sayoc
61a681de19 [TechDraw] Fix incorrect centering of dimension label
and improve rendering of frame
Fixes #15103
2024-09-02 16:53:37 -04:00
PaddleStroke
3375bbfb8e TechDraw: Snap: disable snap if ALT is pressed. 2024-06-25 09:16:51 -05:00
wmayer
127f935711 Fix several compiler warnings
* -Wmaybe-uninitialized
* -Wunused-parameter
* -Wunused-variable
* -Wnonnull
* -Wstringop-truncation
* -Wstringop-overflow
2024-06-19 21:14:23 -05:00
PaddleStroke
c335ecb5ae TechDraw: Snapping: Fix bug where distanceX dimensions would wrongly compare to all dimensions. 2024-06-03 11:58:58 -04:00
PaddleStroke
cc4dd7ca64 TechDraw: Dimension Snapping : Enable different types of dimensions to snap together. 2024-06-03 11:58:58 -04:00
PaddleStroke
fcf973170b TechDraw: Dimension: fix centering snapping. 2024-06-03 11:58:58 -04:00
wmayer
3e23bd759b Mod: Fix several compiler warnings 2024-05-30 08:55:11 +02:00
PaddleStroke
f523f6c3ad TechDraw: Introduce dimension snapping 2024-05-27 11:44:31 -04:00
PaddleStroke
80fb3a492c TechDraw: Dimension: Allow snapping label to its center position. 2024-05-27 11:44:31 -04:00
PaddleStroke
cc393632e1 Techdraw: Smart Dimension: Fixes and simplifies code 2024-05-13 15:03:37 +02:00
PaddleStroke
41650a78d4 TechDraw: Implement 'Area' dimension. 2024-05-06 18:42:28 +02:00
wmayer
48ff9ad3a1 [TD]Refactor LTNP correction code for Dimensions
- additional geometry types

- add method to handle line like bsplines

- handle deleted ref body feature

- add test for empty savedGeometry

- add switch for matcher/LTNP on/off
2024-03-17 08:56:34 -04:00
wandererfan
c94a419eac [TD]fix over/under tolerance
- left justify tolerances
- use format spec for tolerance == zero
- prevent uncommanded tolerance format changes
- use 'w' format for HoleShaftFit
- allow zero tolerance values for HoleShaftFit
2024-03-14 21:45:16 -04:00
Tomas Pavlicek
1cf7861b51 [TechDraw] Implement proper selection of subitems (#11804) 2023-12-22 08:25:58 -05:00
wandererfan
b8bea76481 [TD]spelling in comments 2023-11-26 16:42:06 -05:00
wandererfan
9d3d7aba22 [TD]fix dimension location 2023-11-25 08:05:50 -05:00
Florian Foinant-Willig
2d27b84686 TechDraw: fix extension lines of projected dimension 2023-10-02 13:53:01 -04:00
wandererfan
9a6f12d9c6 [TD]fix selection highlighting from tree 2023-09-03 10:09:42 -04:00
wandererfan
9ad7a0ea72 [TD]use vp Property for arrow size 2023-06-07 12:38:26 -04:00
luzpaz
4e2124e1d3 Fix misc. linting and typos
Trim whitespace; move imports to separate lines, fix typos
2023-04-25 17:14:39 +02:00
Benjamin Bræstrup Sayoc
ddff39dbac [TechDraw] Add customizability for dimension line spacing 2023-04-15 10:20:38 -04:00
Benjamin Bræstrup Sayoc
a93060c6b9 [TechDraw] Simplify return logic
Normal warmup
2023-04-11 13:49:57 -04:00
Benjamin Bræstrup Sayoc
3794897699 [TechDraw] Simplify return logic 2023-04-10 23:34:05 -04:00
Benjamin Bræstrup Sayoc
5d05acc87e [TechDraw] Simplify retrievement of user preferences
for all TechDraw files
2023-04-10 23:34:05 -04:00
wandererfan
8a11528a7e [TD]corrupt dim reference detect and correct 2023-03-22 20:09:35 -04:00
wmayer
25beef481c TD: move to new style connect() 2023-02-01 01:33:34 +01:00
wandererfan
437457e996 [TD]remove obsolete log messages 2023-01-13 12:15:33 -05:00
Uwe
c947055821 [TD] remove unused headers (#8155)
* [TD] remove unused headers

- also some sorting
- also improve readability by not using an abbreviation (we consistently don't abbreviate class names)
2023-01-09 14:55:22 +01:00
wandererfan
503b58daee [TD]fix dimension retains light on dark colour 2023-01-08 17:50:49 -05:00
wandererfan
208104e9e0 [TD]Refactor Dimensions for 3d upgrade
- separate validation, geometry and reference handling into
  individual files
- improve 3d reference geometry handling
- eliminate duplicate dim creation code

- add Dimension reference repair dialog

- Refactor formatting out of DrawViewDimension

- move dimension repaint control to ViewProvider
2023-01-07 16:32:03 -05:00
wandererfan
0e402ae075 [TD]add light text on dark page mode
- some visually impaired users need white graphics on
  dark page.

- revise Annotation dialog to respect dark style
2023-01-03 17:41:33 -05:00
Uwe
7a2d0037ff [TD] QGIView*: remove unused includes
- also some sorting
2022-12-04 04:21:01 +01:00
Wanderer Fan
99f2820712 [TD]fix Text sizes not exact 2022-09-07 16:06:54 -04:00
wandererfan
aa2b1b8392 [TD]CI clang warnings 2022-09-05 17:48:38 -04:00
Benjamin Bræstrup Sayoc
b498e85f43 [TechDraw] Remove uneeded redefinitions of inherited functions 2022-08-12 18:13:52 -04:00
Wanderer Fan
cf52d87dba [TD]fix multiple dimension drag 2022-08-10 14:09:08 -04:00
berniev
f4ffd15864 Mod: redundant void 2 2022-08-08 10:27:50 +02:00
berniev
53ba98d636 Mod: use empty 2022-08-06 19:30:13 +02:00
Uwe
b2bb479788 [TD] last part of removal of superfluous nullptr checks 2022-07-20 12:17:16 +02:00
Uwe
b81d7e4864 [TD] remove some more superfluous nullptr checks 2022-07-20 11:54:28 +02:00
Uwe
5486c9808d [TD] remove some more superfluous nullptr checks 2022-07-20 02:53:48 +02:00
Uwe
b514f47c21 [TD] Gui: remove some superfluous nullptr checks 2022-07-19 02:49:46 +02:00
Wanderer Fan
fe47248dea [TD]adjustable extension line gap 2022-07-04 20:43:49 -04:00
Wanderer Fan
a799a5db66 [TD]fix Dimension/Balloon movement 2022-06-02 16:33:25 -04:00