mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-12 02:40:00 +01:00
More freedom of grab translation for all views
This commit is contained in:
@@ -186,7 +186,7 @@ void GeometryView::resize ( int scale )
|
|||||||
scene.root()->scale_.y = z;
|
scene.root()->scale_.y = z;
|
||||||
|
|
||||||
// Clamp translation to acceptable area
|
// Clamp translation to acceptable area
|
||||||
glm::vec3 border(scene.root()->scale_.x * 1.5, scene.root()->scale_.y * 1.5, 0.f);
|
glm::vec3 border(2.f * Mixer::manager().session()->frame()->aspectRatio(), 2.f, 0.f);
|
||||||
scene.root()->translation_ = glm::clamp(scene.root()->translation_, -border, border);
|
scene.root()->translation_ = glm::clamp(scene.root()->translation_, -border, border);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -217,9 +217,8 @@ void LayerView::resize ( int scale )
|
|||||||
scene.root()->scale_.y = z;
|
scene.root()->scale_.y = z;
|
||||||
|
|
||||||
// Clamp translation to acceptable area
|
// Clamp translation to acceptable area
|
||||||
glm::vec3 border_left(scene.root()->scale_.x * -2.f, scene.root()->scale_.y * -1.f, 0.f);
|
glm::vec3 border(2.f, 1.f, 0.f);
|
||||||
glm::vec3 border_right(scene.root()->scale_.x * 8.f, scene.root()->scale_.y * 8.f, 0.f);
|
scene.root()->translation_ = glm::clamp(scene.root()->translation_, -border, border * 2.f);
|
||||||
scene.root()->translation_ = glm::clamp(scene.root()->translation_, border_left, border_right);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int LayerView::size ()
|
int LayerView::size ()
|
||||||
|
|||||||
@@ -250,7 +250,8 @@ void MixingView::resize ( int scale )
|
|||||||
scene.root()->scale_.y = z;
|
scene.root()->scale_.y = z;
|
||||||
|
|
||||||
// Clamp translation to acceptable area
|
// 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);
|
scene.root()->translation_ = glm::clamp(scene.root()->translation_, -border, border);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -252,7 +252,7 @@ void TextureView::resize ( int scale )
|
|||||||
scene.root()->scale_.y = z;
|
scene.root()->scale_.y = z;
|
||||||
|
|
||||||
// Clamp translation to acceptable area
|
// Clamp translation to acceptable area
|
||||||
glm::vec3 border(scene.root()->scale_.x * 1.5, scene.root()->scale_.y * 1.5, 0.f);
|
glm::vec3 border(2.f * Mixer::manager().session()->frame()->aspectRatio(), 2.f, 0.f);
|
||||||
scene.root()->translation_ = glm::clamp(scene.root()->translation_, -border, border);
|
scene.root()->translation_ = glm::clamp(scene.root()->translation_, -border, border);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
6
View.cpp
6
View.cpp
@@ -287,3 +287,9 @@ void View::lock(Source *s, bool on)
|
|||||||
Action::manager().store(s->name() + std::string(": unlock."));
|
Action::manager().store(s->name() + std::string(": unlock."));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
glm::vec2 View::resolution() const
|
||||||
|
{
|
||||||
|
const ImGuiIO& io = ImGui::GetIO();
|
||||||
|
return glm::vec2(io.DisplaySize.x, io.DisplaySize.y);
|
||||||
|
}
|
||||||
|
|||||||
3
View.h
3
View.h
@@ -88,6 +88,9 @@ public:
|
|||||||
// left-right [-1 1] and up-down [1 -1] action from arrow keys
|
// left-right [-1 1] and up-down [1 -1] action from arrow keys
|
||||||
virtual void arrow (glm::vec2) {}
|
virtual void arrow (glm::vec2) {}
|
||||||
|
|
||||||
|
// resolution on screen
|
||||||
|
glm::vec2 resolution() const;
|
||||||
|
|
||||||
// accessible scene
|
// accessible scene
|
||||||
Scene scene;
|
Scene scene;
|
||||||
|
|
||||||
|
|||||||
@@ -40,7 +40,7 @@
|
|||||||
#define GEOMETRY_MIN_SCALE 0.4f
|
#define GEOMETRY_MIN_SCALE 0.4f
|
||||||
#define GEOMETRY_MAX_SCALE 7.0f
|
#define GEOMETRY_MAX_SCALE 7.0f
|
||||||
#define LAYER_DEFAULT_SCALE 0.6f
|
#define LAYER_DEFAULT_SCALE 0.6f
|
||||||
#define LAYER_MIN_SCALE 0.4f
|
#define LAYER_MIN_SCALE 0.25f
|
||||||
#define LAYER_MAX_SCALE 1.7f
|
#define LAYER_MAX_SCALE 1.7f
|
||||||
#define LAYER_PERSPECTIVE 2.0f
|
#define LAYER_PERSPECTIVE 2.0f
|
||||||
#define LAYER_BACKGROUND 2.f
|
#define LAYER_BACKGROUND 2.f
|
||||||
|
|||||||
Reference in New Issue
Block a user