From 67b45c7daefbdacbe5ef70cfce8d8c9cce5ebb97 Mon Sep 17 00:00:00 2001 From: Abdullah Tahiri Date: Thu, 14 Jan 2021 16:27:48 +0100 Subject: [PATCH] Sketcher: fix font size --- src/Mod/Sketcher/Gui/ViewProviderSketch.cpp | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp b/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp index 58953462d2..643f404d04 100644 --- a/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp +++ b/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp @@ -76,10 +76,6 @@ # include #endif - - - - /// Here the FreeCAD includes sorted by Base,App,Gui...... #include #include @@ -188,8 +184,8 @@ struct EditData { PreselectCurve(-1), PreselectCross(-1), MarkerSize(7), - coinFontSize(11), // default of 11 points (not pixels) - constraintIconSize(15), // 11 points @ 96 ppi where 72 points = 1 inch + coinFontSize(17), // this value is in pixels, 17 pixels + constraintIconSize(15), blockedPreselection(false), FullyConstrained(false), //ActSketch(0), // if you are wondering, it went to SketchObject, accessible via getSolvedSketch() and via SketchObject interface as appropriate @@ -3831,21 +3827,13 @@ void ViewProviderSketch::initItemsSizes() int defaultFontSizePixels = QApplication::fontMetrics().height(); // returns height in pixels, not points int sketcherfontSize = hGrp->GetInt("EditSketcherFontSize", defaultFontSizePixels); - auto pixelsToPoints = [](int pixels, int dpi) { - return pixels*72/dpi; // definition of point, 72 points = 1 inch - }; - - // coin takes the font size in points, not pixels - // the coin FontSize in points from the system font, taking into account the application scaling factor is: - // -> pixelsToPoints(defaultFontSizePixels * viewScalingFactor, dpi) - int dpi = QApplication::desktop()->logicalDpiX(); if(edit) { // simple scaling factor for hardcoded pixel values in the Sketcher edit->pixelScalingFactor = viewScalingFactor * dpi / 96; // 96 ppi is the standard pixel density for which pixel quantities were calculated - edit->coinFontSize = pixelsToPoints(sketcherfontSize, dpi); + edit->coinFontSize = sketcherfontSize; edit->constraintIconSize = std::lround(0.8 * sketcherfontSize); // For marker size the global default is used.