From 466c59431da2df1361a375d98847963aefcedc18 Mon Sep 17 00:00:00 2001 From: vsv Date: Thu, 12 Jul 2018 11:59:01 +0300 Subject: [PATCH] Fix for sketcher custom colors --- src/SketchPlugin/SketchPlugin_SketchEntity.h | 8 ++++++++ 1 file changed, 8 insertions(+) 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]; -- 2.39.2