puObject(x, y, width, height),
_canvas_mgr( dynamic_cast<CanvasMgr*>(globals->get_subsystem("Canvas")) ),
_last_x(0),
- _last_y(0)
+ _last_y(0),
+ _auto_viewport( props->getBoolValue("auto-viewport", true) )
{
if( !_canvas_mgr )
{
{
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);
+ }
}
//------------------------------------------------------------------------------
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;