From 9548d347a4051fc957d35169f507bf1d719f748e Mon Sep 17 00:00:00 2001 From: wmayer Date: Mon, 24 Dec 2012 13:00:30 +0100 Subject: [PATCH] Use current background to save to image when not using color gradient --- src/Gui/View3DInventorViewer.cpp | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/src/Gui/View3DInventorViewer.cpp b/src/Gui/View3DInventorViewer.cpp index 6a0b733c5..9cc832e60 100644 --- a/src/Gui/View3DInventorViewer.cpp +++ b/src/Gui/View3DInventorViewer.cpp @@ -525,9 +525,14 @@ void View3DInventorViewer::savePicture(const char* filename, int w, int h, // if we use transparency then we must not set a background color switch(eBackgroundType){ case Current: - useBackground = true; - cb = new SoCallback; - cb->setCallback(clearBuffer); + if (backgroundroot->findChild(pcBackGround) == -1) { + renderer.setBackgroundColor(this->getBackgroundColor()); + } + else { + useBackground = true; + cb = new SoCallback; + cb->setCallback(clearBuffer); + } break; case White: renderer.setBackgroundColor( SbColor(1.0, 1.0, 1.0) ); @@ -595,9 +600,14 @@ void View3DInventorViewer::savePicture(int w, int h, int eBackgroundType, QImage // if we use transparency then we must not set a background color switch(eBackgroundType){ case Current: - useBackground = true; - cb = new SoCallback; - cb->setCallback(clearBuffer); + if (backgroundroot->findChild(pcBackGround) == -1) { + renderer.setBackgroundColor(this->getBackgroundColor()); + } + else { + useBackground = true; + cb = new SoCallback; + cb->setCallback(clearBuffer); + } break; case White: renderer.setBackgroundColor( SbColor(1.0, 1.0, 1.0) );