diff --git a/src/GUI/CanvasWidget.cxx b/src/GUI/CanvasWidget.cxx index b2aeb59c4..3c99f9091 100644 --- a/src/GUI/CanvasWidget.cxx +++ b/src/GUI/CanvasWidget.cxx @@ -29,7 +29,8 @@ CanvasWidget::CanvasWidget( int x, int y, puObject(x, y, width, height), _canvas_mgr( dynamic_cast(globals->get_subsystem("Canvas")) ), _last_x(0), - _last_y(0) + _last_y(0), + _auto_viewport( props->getBoolValue("auto-viewport", true) ) { if( !_canvas_mgr ) { @@ -185,8 +186,11 @@ void CanvasWidget::setSize(int w, int h) { puObject::setSize(w, h); - _canvas->getProps()->setIntValue("view[0]", w); - _canvas->getProps()->setIntValue("view[1]", h); + if( _auto_viewport ) + { + _canvas->getProps()->setIntValue("view[0]", w); + _canvas->getProps()->setIntValue("view[1]", h); + } } //------------------------------------------------------------------------------ diff --git a/src/GUI/CanvasWidget.hxx b/src/GUI/CanvasWidget.hxx index a91193814..8d4f60780 100644 --- a/src/GUI/CanvasWidget.hxx +++ b/src/GUI/CanvasWidget.hxx @@ -40,6 +40,9 @@ class CanvasWidget: float _last_x, _last_y; + bool _auto_viewport; //!< Set true to get the canvas view dimensions + // automatically resized if the size of the widget + // changes. static SGPropertyNode_ptr _time, _view_height;