diff --git a/widgets/glWidget/QtBaseViewer.cc b/widgets/glWidget/QtBaseViewer.cc index f109b8358f3f06ae8bc36da57b8db0dd4c205e04..4256dc9b97fa93298211285e43ac77edccbc5bac 100644 --- a/widgets/glWidget/QtBaseViewer.cc +++ b/widgets/glWidget/QtBaseViewer.cc @@ -2200,7 +2200,8 @@ void glViewer::slotPropertiesUpdated() { } void glViewer::snapshot(QImage& _image, int _width, int _height, bool _alpha, bool _hideCoordsys, int samples) { - + makeCurrent(); + int w = 0, h = 0, bak_w = 0, bak_h = 0, left = 0, bottom = 0; glstate_->push_modelview_matrix(); @@ -2240,7 +2241,6 @@ void glViewer::snapshot(QImage& _image, int _width, int _height, bool _alpha, bo // it will fall back to the maximal supported number of samples format.setSamples(samples); - makeCurrent(); QFramebufferObject fb(w,h,format); if ( fb.isValid() ){