X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSketcherPrs%2FSketcherPrs_SymbolPrs.cpp;h=f52a48c5dff67ffdeebcad64edd8d918ddd73637;hb=449259f5540f1e1d7e5e0595e10f80e18a15e038;hp=03d1e26f7b65f3a0488c1f5f11287c58192c451c;hpb=97917d3698f5a2f7fc9596e7c755ff8f6751e373;p=modules%2Fshaper.git diff --git a/src/SketcherPrs/SketcherPrs_SymbolPrs.cpp b/src/SketcherPrs/SketcherPrs_SymbolPrs.cpp index 03d1e26f7..f52a48c5d 100644 --- a/src/SketcherPrs/SketcherPrs_SymbolPrs.cpp +++ b/src/SketcherPrs/SketcherPrs_SymbolPrs.cpp @@ -120,7 +120,7 @@ std::map SketcherPrs_SymbolPrs::myIconsM SketcherPrs_SymbolPrs::SketcherPrs_SymbolPrs(ModelAPI_Feature* theConstraint, SketchPlugin_Sketch* theSketcher) : AIS_InteractiveObject(), myConstraint(theConstraint), - myPlane(theSketcher->coordinatePlane()), myIsCustomColor(false), + myIsCustomColor(false), mySketcher(theSketcher) { SetAutoHilight(Standard_False); @@ -168,7 +168,7 @@ Handle(Image_AlienPixMap) SketcherPrs_SymbolPrs::icon() aFile = std::string(anEnv) + FSEP + "share" + FSEP + "salome" + FSEP + "resources" + FSEP + "shaper"; } else { - anEnv = getenv("OPENPARTS_ROOT_DIR"); + anEnv = getenv("CADBUILDER_ROOT_DIR"); if (anEnv) aFile = std::string(anEnv) + FSEP + "resources"; } @@ -177,12 +177,25 @@ 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(); + if (aRatio > 1) { + Handle(Image_AlienPixMap) aSizedMap = new Image_AlienPixMap(); + Standard_Size aWidth = aPixMap->Width() * aRatio; + Standard_Size aHeigh = aPixMap->Height() * aRatio; + aSizedMap->InitTrash(aPixMap->Format(), aWidth, aHeigh); + for (Standard_Size i = 0; i < aWidth; i++) { + for (Standard_Size j = 0; j < aHeigh; j++) { + aSizedMap->SetPixelColor(int(i), int(j), aPixMap->PixelColor(i / aRatio, j / aRatio)); + } + } + aPixMap = aSizedMap; + } myIconsMap[iconName()] = aPixMap; return aPixMap; } // The icon for constraint is not found static const char aMsg[] = "Error! constraint images are not found"; - cout<