More freedom of grab translation for all views

This commit is contained in:
Bruno Herbelin
2021-11-17 23:09:49 +01:00
parent fc4e3dc362
commit 6a3ff2f235
7 changed files with 16 additions and 7 deletions

View File

@@ -250,7 +250,8 @@ void MixingView::resize ( int scale )
scene.root()->scale_.y = z;
// Clamp translation to acceptable area
glm::vec3 border(scene.root()->scale_.x * 1.f, scene.root()->scale_.y * 1.f, 0.f);
glm::vec2 res = resolution();
glm::vec3 border(2.3f * res.x/res.y, 2.3f, 0.f);
scene.root()->translation_ = glm::clamp(scene.root()->translation_, -border, border);
}