bkloppenborg / simtoi

The SImulation and Modeling Tool for Optical Interferometry
GNU General Public License v3.0
7 stars 6 forks source link

File -> Open does not restore model scale #61

Closed bkloppenborg closed 11 years ago

bkloppenborg commented 11 years ago

The new file -> open dialog (i.e. in the develop branch) does restore the model and set the new window size, but it does not restore the saved window scale. It appears we need to implement a Resize(width, height) function which tells all OpenCL and OpenGL buffers that the window is being resized and any buffers which use the image data need to be invalidated and re-allocated.

While you are at it, also subclass QMdiSubWindow and overrride the setFixedSize method to include the window border by default:

setFixedSize(unsigned int width, unsigned int height)
{
    int frame_width = 8;
    int frame_height = 28;

    QMdiSubWindow::setFixedSize(width + frame_width, height + frame_height);

Remove the corresponding code in gui_main::AddGLArea and CGLWidget::Open.