X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSketcherPrs%2FSketcherPrs_SymbolPrs.cpp;h=5f79c5fbaec5d90b5dca3abe513ef441be0c4bf3;hb=ea593bc59e7e9461f6c4e2afd3f24d621edb1011;hp=d23827aa7f745111e1cf1edda79b1b2e1bfad6a3;hpb=95375993f1f35e4716475c0b0c8e265c082c875d;p=modules%2Fshaper.git diff --git a/src/SketcherPrs/SketcherPrs_SymbolPrs.cpp b/src/SketcherPrs/SketcherPrs_SymbolPrs.cpp index d23827aa7..5f79c5fba 100644 --- a/src/SketcherPrs/SketcherPrs_SymbolPrs.cpp +++ b/src/SketcherPrs/SketcherPrs_SymbolPrs.cpp @@ -177,6 +177,19 @@ 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(i, j, aPixMap->PixelColor(i / aRatio, j / aRatio)); + } + } + aPixMap = aSizedMap; + } myIconsMap[iconName()] = aPixMap; return aPixMap; } @@ -261,6 +274,8 @@ void SketcherPrs_SymbolPrs::Compute( const Handle(Prs3d_Presentation)& thePresentation, const Standard_Integer theMode) { + if (!plane().get()) + return; // Create an icon prepareAspect();