Salome HOME
[bos #32216][CEA] GUI ergonomic. Fixed scaling of Sketcher symbols because of using... kleontev/32216_GUI_ergonomic master 62/head
authorKonstantin Leontev <Konstantin.LEONTEV@opencascade.com>
Fri, 10 May 2024 10:49:43 +0000 (11:49 +0100)
committerKonstantin Leontev <Konstantin.LEONTEV@opencascade.com>
Wed, 22 May 2024 09:44:53 +0000 (10:44 +0100)
src/SketcherPrs/SketcherPrs_Coincident.cpp
src/SketcherPrs/SketcherPrs_SymbolPrs.cpp
src/SketcherPrs/SketcherPrs_Tools.cpp
src/SketcherPrs/SketcherPrs_Tools.h

index 65ca0fc0dc337fb9ce24386712c35e80b24d62eb..a4481383804979d8a4872474fdb20f897a60a652 100644 (file)
@@ -143,7 +143,7 @@ void SketcherPrs_Coincident::Compute(
   Quantity_Color aExternalColor = aIsEdge ? aMainColor : Quantity_NOC_YELLOW;
   Quantity_Color aInternalColor = aIsEdge ? Quantity_NOC_YELLOW : aMainColor;
 
-  int aRatio = SketcherPrs_Tools::pixelRatio();
+  const double aRatio = SketcherPrs_Tools::pixelRatio();
 
   // Create the presentation as a combination of standard point markers
   // The external yellow contour
index efc2cc546679cd75a3c0fe28fc1c0e63bb260914..de2569009fbabd56088368c8b54beac231768830 100644 (file)
@@ -178,7 +178,7 @@ Handle(Image_AlienPixMap) SketcherPrs_SymbolPrs::icon()
   aFile += iconName();
   Handle(Image_AlienPixMap) aPixMap = new Image_AlienPixMap();
   if (aPixMap->Load(aFile.c_str())) {
-    int aRatio = SketcherPrs_Tools::pixelRatio();
+    const double aRatio = SketcherPrs_Tools::pixelRatio();
     if (aRatio > 1) {
       Handle(Image_AlienPixMap) aSizedMap = new Image_AlienPixMap();
       Standard_Size aWidth = aPixMap->Width() * aRatio;
index 03fb0c44b416dd1407839cbe963ee8489adba446..841679cf066c2cb0cd6641b5c01c6f46d2126c86 100644 (file)
@@ -288,14 +288,14 @@ std::shared_ptr<GeomAPI_Pnt2d> getProjectionPoint(const FeaturePtr theLine,
   return aLin2d.project(thePoint);
 }
 
-static int MyPixelRatio = 1;
+static double MyPixelRatio = 1.0;
 
-void setPixelRatio(int theRatio)
+void setPixelRatio(const double theRatio)
 {
   MyPixelRatio = theRatio;
 }
 
-int pixelRatio()
+double pixelRatio()
 {
   return MyPixelRatio;
 }
index 254605ba202e67f8105b95c6fbc10d0e93c83da2..da6bac84fc35a3976c83cdf57b43633ebd7c8457 100644 (file)
@@ -180,9 +180,9 @@ namespace SketcherPrs_Tools {
   SKETCHERPRS_EXPORT void sendEmptyPresentationError(ModelAPI_Feature* theFeature,
                                                      const std::string theError);
 
-  SKETCHERPRS_EXPORT void setPixelRatio(int theRatio);
+  SKETCHERPRS_EXPORT void setPixelRatio(const double theRatio);
 
-  SKETCHERPRS_EXPORT int pixelRatio();
+  SKETCHERPRS_EXPORT double pixelRatio();
 };
 
 #endif