Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sketcher: Constraint icons and fonts in 3D View
=============================================== Based on PRs #4146 #4155. PR #4155 proposes a scaling factor to be used to scale up constraint icons and the subindex font of icons. The scaling factor is a parameter. PR #4146 proposes to derive the constraint icon size from the system font size via function of the dpi. The constraint icon subindex is a factor of the constraint size. Observations: - PR #4146 identifies the need for a scaling factor too, but this is a hardcoded 1.25 factor. - PR #4146 appears to mix font points and font pixels when deriving the sizes. - PR #4155 deals exclusively with icon size and subindex font, not with constraint label Useful concepts: - Font point is a physical distance. There are 72 points in one inch. - Monitors have pixels with varying pixel densities. The number of pixels in one point varies with pixel density. Hence the need for a correction based on the dpi of the monitor. API constraints: - While QT's configuration can be obtained in points or pixels, coin3D sets the font size in points. Solution: - Continue relying on the local font setting from preferences for coin3d font, albeit by converting from pixels to points. - Introduce a sketcher wide 3D view scaling factor, as per #4155. This factor is however used for geometry, not for fonts. - Geometry is scaled to compensate for the scaling factor and the monitor pixel density (the scaling factor is the product of both scaling factors). - Derive the 3D view icon size to be 80% (hardcoded) of the 3D view font size. Having constraint icons proportional to contraint label font size gives consistency to the interface, as constraint icons also have subindices. I do not think it is worth to provide this 80% as a configurable parameter - The constraint icon subindex, being a special case of font relative to the accompanying icon, is set to be the 80% of the icon size (hardcoded). I think it is not worth to provide this as a configurable parameter. Bonus: - ViewProviderSketch implements an observer of parameter group and tracks view scaling factor parameter and marker size. - On change of parameter the inventor nodes are updated and the 3D view redrawn. - Size information is moved to edit structure for consistency with Marker size.
- Loading branch information
1 parent
1d970d5
commit 3661ffe
Showing
3 changed files
with
159 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.