X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModuleBase%2FModuleBase_Tools.cpp;h=21fa0db1f29eb7d676bf0b2aab3a964a6272268b;hb=a2982d2108f929cf9e7f996cfd590c4ce59dc21c;hp=0f57b4c7b7fedc812fa84c3cc465d9d369d6205f;hpb=e87259160f612bdf93435ccb8399c96bd7fba671;p=modules%2Fshaper.git diff --git a/src/ModuleBase/ModuleBase_Tools.cpp b/src/ModuleBase/ModuleBase_Tools.cpp index 0f57b4c7b..21fa0db1f 100644 --- a/src/ModuleBase/ModuleBase_Tools.cpp +++ b/src/ModuleBase/ModuleBase_Tools.cpp @@ -1,3 +1,5 @@ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D + // File: ModuleBase_Tools.cpp // Created: 11 July 2014 // Author: Vitaly Smetannikov @@ -44,8 +46,7 @@ void zeroMargins(QLayout* theLayout) theLayout->setSpacing(5); } -QPixmap composite(const QString& theAdditionalIcon, const int theXShift, - const int theYShift, const QString& theIcon) +QPixmap composite(const QString& theAdditionalIcon, const QString& theIcon) { QImage anIcon(theIcon); QImage anAditional(theAdditionalIcon); @@ -59,12 +60,12 @@ QPixmap composite(const QString& theAdditionalIcon, const int theXShift, int aWidth = anIcon.width(); int aHeight = anIcon.height(); - int aStartWidthPos = aWidth-anAddWidth-1; - int aStartHeightPos = aHeight-anAddHeight-1; + int aStartWidthPos = aWidth - anAddWidth - 1; + int aStartHeightPos = aHeight - anAddHeight - 1; - for (int i = 0; i < anAddWidth; i++) + for (int i = 0; i < anAddWidth && i + aStartWidthPos < aWidth; i++) { - for (int j = 0; j < anAddHeight; j++) + for (int j = 0; j < anAddHeight && j + aStartHeightPos < aHeight; j++) { if (qAlpha(anAditional.pixel(i, j)) > 0) anIcon.setPixel(i + aStartWidthPos, j + aStartHeightPos, anAditional.pixel(i, j));