From: Konstantin Leontev Date: Fri, 10 May 2024 10:49:43 +0000 (+0100) Subject: [bos #32216][CEA] GUI ergonomic. Fixed scaling of Sketcher symbols because of using... X-Git-Tag: V9_13_0a1~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2Fkleontev%2F32216_GUI_ergonomic;p=modules%2Fshaper.git [bos #32216][CEA] GUI ergonomic. Fixed scaling of Sketcher symbols because of using integer for pixel rate. --- diff --git a/src/SketcherPrs/SketcherPrs_Coincident.cpp b/src/SketcherPrs/SketcherPrs_Coincident.cpp index 65ca0fc0d..a44813838 100644 --- a/src/SketcherPrs/SketcherPrs_Coincident.cpp +++ b/src/SketcherPrs/SketcherPrs_Coincident.cpp @@ -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 diff --git a/src/SketcherPrs/SketcherPrs_SymbolPrs.cpp b/src/SketcherPrs/SketcherPrs_SymbolPrs.cpp index efc2cc546..de2569009 100644 --- a/src/SketcherPrs/SketcherPrs_SymbolPrs.cpp +++ b/src/SketcherPrs/SketcherPrs_SymbolPrs.cpp @@ -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; diff --git a/src/SketcherPrs/SketcherPrs_Tools.cpp b/src/SketcherPrs/SketcherPrs_Tools.cpp index 03fb0c44b..841679cf0 100644 --- a/src/SketcherPrs/SketcherPrs_Tools.cpp +++ b/src/SketcherPrs/SketcherPrs_Tools.cpp @@ -288,14 +288,14 @@ std::shared_ptr 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; } diff --git a/src/SketcherPrs/SketcherPrs_Tools.h b/src/SketcherPrs/SketcherPrs_Tools.h index 254605ba2..da6bac84f 100644 --- a/src/SketcherPrs/SketcherPrs_Tools.h +++ b/src/SketcherPrs/SketcherPrs_Tools.h @@ -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