FreeCAD: master 3661ffe7
Author | Committer | Branch | Timestamp | Parent |
---|---|---|---|---|
abdullah | abdullahtahiriyo | master | 2021-01-05 14:03:47 | master 1d970d52 |
Changeset | Sketcher: Constraint icons and fonts in 3D View =============================================== Based on PRs 0004146 0004155. PR 0004155 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 0004146 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 0004146 identifies the need for a scaling factor too, but this is a hardcoded 1.25 factor. - PR 0004146 appears to mix font points and font pixels when deriving the sizes. - PR 0004155 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 0004155. 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. |
|||
mod - src/Mod/Sketcher/Gui/SoDatumLabel.cpp | Diff File | |||
mod - src/Mod/Sketcher/Gui/ViewProviderSketch.cpp | Diff File | |||
mod - src/Mod/Sketcher/Gui/ViewProviderSketch.h | Diff File |