Skip to content

Commit 3f7edca

Browse files
committed
Merge pull request #926 from SCIInstitute/bgColor
Closes #921
2 parents d90cb68 + a71f60c commit 3f7edca

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

src/Interface/Modules/Render/ViewScene.cc

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,16 +100,21 @@ ViewSceneDialog::ViewSceneDialog(const std::string& name, ModuleStateHandle stat
100100

101101
{
102102
//Set background Color
103-
ColorRGB color(state_->getValue(Modules::Render::ViewScene::BackgroundColor).toString());
104-
bgColor_ = QColor(static_cast<int>(color.r() > 1 ? color.r() : color.r() * 255.0),
105-
static_cast<int>(color.g() > 1 ? color.g() : color.g() * 255.0),
106-
static_cast<int>(color.b() > 1 ? color.b() : color.b() * 255.0));
107-
103+
if (state_->getValue(Modules::Render::ViewScene::BackgroundColor).toString() != "")
104+
{
105+
ColorRGB color(state_->getValue(Modules::Render::ViewScene::BackgroundColor).toString());
106+
bgColor_ = QColor(static_cast<int>(color.r() > 1 ? color.r() : color.r() * 255.0),
107+
static_cast<int>(color.g() > 1 ? color.g() : color.g() * 255.0),
108+
static_cast<int>(color.b() > 1 ? color.b() : color.b() * 255.0));
109+
}
110+
else
111+
{
112+
bgColor_ = Qt::black;
113+
}
108114
std::shared_ptr<Render::SRInterface> spire = mSpire.lock();
109115
spire->setBackgroundColor(bgColor_);
110116
}
111117

112-
113118
state->connect_state_changed(boost::bind(&ViewSceneDialog::newGeometryValueForwarder, this));
114119
connect(this, SIGNAL(newGeometryValueForwarder()), this, SLOT(newGeometryValue()));
115120

0 commit comments

Comments
 (0)