From: vsv Date: Thu, 12 Jul 2018 08:59:01 +0000 (+0300) Subject: Fix for sketcher custom colors X-Git-Tag: SHAPER_V9_1_0RC1~129 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=466c59431da2df1361a375d98847963aefcedc18;p=modules%2Fshaper.git Fix for sketcher custom colors --- diff --git a/src/SketchPlugin/SketchPlugin_SketchEntity.h b/src/SketchPlugin/SketchPlugin_SketchEntity.h index 0f792ec54..78a0429d7 100644 --- a/src/SketchPlugin/SketchPlugin_SketchEntity.h +++ b/src/SketchPlugin/SketchPlugin_SketchEntity.h @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -151,6 +152,13 @@ class SketchPlugin_SketchEntity : public SketchPlugin_Feature, public GeomAPI_IC aColor = Config_PropManager::color("Visualization", "sketch_entity_color"); } if (!aColor.empty()) { + if (theResult.get()) { + AttributeIntArrayPtr aColorAttr = theResult->data()->intArray(ModelAPI_Result::COLOR_ID()); + aColorAttr->setSize(3); + // Set the color attribute in order do not use default colors in the perasentation object + for (int i = 0; i < 3; i++) + aColorAttr->setValue(i, aColor[i]); + } thePrs->setColor(aColor[0], aColor[1], aColor[2]); for (int i = 0; i < 3 && !isCustomized; i++) isCustomized = aColor[i] != aPrevColor[i];