From: Thomas Geymayer Date: Mon, 25 Feb 2013 14:39:30 +0000 (+0100) Subject: CanvasWidget: automatically set auto-viewport. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=3ea69785d92acce3a50df32a6e326a69f299adac;p=flightgear.git CanvasWidget: automatically set auto-viewport. If no viewport dimensions are given the viewport will now automatically resize, otherwise it stays unchanged. --- diff --git a/src/GUI/CanvasWidget.cxx b/src/GUI/CanvasWidget.cxx index 3c99f9091..7113bef42 100644 --- a/src/GUI/CanvasWidget.cxx +++ b/src/GUI/CanvasWidget.cxx @@ -30,7 +30,8 @@ CanvasWidget::CanvasWidget( int x, int y, _canvas_mgr( dynamic_cast(globals->get_subsystem("Canvas")) ), _last_x(0), _last_y(0), - _auto_viewport( props->getBoolValue("auto-viewport", true) ) + // automatically resize viewport of canvas if no size is given + _auto_viewport( !props->hasChild("view") ) { if( !_canvas_mgr ) {