|
@@ -906,27 +906,17 @@ namespace glfw
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- int original_w = 0;
|
|
|
- int original_h = 0;
|
|
|
- for (auto c: core_list)
|
|
|
- {
|
|
|
- int cur_x = c.viewport(0) + c.viewport(2);
|
|
|
- int cur_y = c.viewport(1) + c.viewport(3);
|
|
|
- if (original_w < cur_x) original_w = cur_x;
|
|
|
- if (original_h < cur_y) original_h = cur_y;
|
|
|
- }
|
|
|
- for (auto &c: core_list)
|
|
|
- {
|
|
|
- c.viewport(0) *= w/original_w;
|
|
|
- c.viewport(2) *= w/original_w;
|
|
|
- c.viewport(1) *= h/original_h;
|
|
|
- c.viewport(3) *= h/original_h;
|
|
|
- }
|
|
|
+ // It is up to the user to define the behavior of the post_resize() function
|
|
|
+ // when there are multiple viewports (through the `callback_post_resize` callback)
|
|
|
}
|
|
|
for (unsigned int i = 0; i<plugins.size(); ++i)
|
|
|
{
|
|
|
plugins[i]->post_resize(w, h);
|
|
|
}
|
|
|
+ if (callback_post_resize)
|
|
|
+ {
|
|
|
+ callback_post_resize(*this, w, h);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
IGL_INLINE void Viewer::snap_to_canonical_quaternion()
|