mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-11 18:34:58 +01:00
Improved zoom slider scaling and display
This commit is contained in:
@@ -1775,9 +1775,9 @@ void Navigator::RenderViewPannel(ImVec2 draw_pos , ImVec2 draw_size)
|
|||||||
ImGui::SetCursorPosX( 10.f);
|
ImGui::SetCursorPosX( 10.f);
|
||||||
draw_size.y -= ImGui::GetCursorPosY() + 10.f;
|
draw_size.y -= ImGui::GetCursorPosY() + 10.f;
|
||||||
int percent_zoom = Mixer::manager().view((View::Mode)Settings::application.current_view)->size();
|
int percent_zoom = Mixer::manager().view((View::Mode)Settings::application.current_view)->size();
|
||||||
ImGui::PushStyleColor(ImGuiCol_FrameBg, ImVec4(0.14, 0.14, 0.14, 0.95));
|
ImGui::PushStyleColor(ImGuiCol_FrameBg, ImVec4(0.1, 0.1, 0.1, 0.95));
|
||||||
ImGui::PushStyleColor(ImGuiCol_FrameBgHovered, ImVec4(0.1, 0.1, 0.1, 0.95));
|
ImGui::PushStyleColor(ImGuiCol_FrameBgHovered, ImVec4(0.14, 0.14, 0.14, 0.95));
|
||||||
ImGui::PushStyleColor(ImGuiCol_FrameBgActive, ImVec4(0.1, 0.1, 0.1, 0.95));
|
ImGui::PushStyleColor(ImGuiCol_FrameBgActive, ImVec4(0.14, 0.14, 0.14, 0.95));
|
||||||
ImGui::PushStyleColor(ImGuiCol_SliderGrab, ImVec4(0.9, 0.9, 0.9, 0.95));
|
ImGui::PushStyleColor(ImGuiCol_SliderGrab, ImVec4(0.9, 0.9, 0.9, 0.95));
|
||||||
if (ImGui::VSliderInt("##z", draw_size, &percent_zoom, 0, 100, "") )
|
if (ImGui::VSliderInt("##z", draw_size, &percent_zoom, 0, 100, "") )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -115,16 +115,6 @@ class UserInterface
|
|||||||
bool show_opengl_about;
|
bool show_opengl_about;
|
||||||
unsigned int screenshot_step;
|
unsigned int screenshot_step;
|
||||||
|
|
||||||
|
|
||||||
// typedef enum {
|
|
||||||
// FILE_DIALOG_INACTIVE = 0,
|
|
||||||
// FILE_DIALOG_ACTIVE,
|
|
||||||
// FILE_DIALOG_FINISHED
|
|
||||||
// } FileDialogStatus;
|
|
||||||
// FileDialogStatus filestatus_;
|
|
||||||
// std::string filename_;
|
|
||||||
// void startOpenFileDialog();
|
|
||||||
|
|
||||||
// Private Constructor
|
// Private Constructor
|
||||||
UserInterface();
|
UserInterface();
|
||||||
UserInterface(UserInterface const& copy); // Not Implemented
|
UserInterface(UserInterface const& copy); // Not Implemented
|
||||||
|
|||||||
24
View.cpp
24
View.cpp
@@ -220,7 +220,7 @@ MixingView::MixingView() : View(MIXING), limbo_scale_(1.3f)
|
|||||||
// no settings found: store application default
|
// no settings found: store application default
|
||||||
Settings::application.views[mode_].name = "Mixing";
|
Settings::application.views[mode_].name = "Mixing";
|
||||||
scene.root()->scale_ = glm::vec3(MIXING_DEFAULT_SCALE, MIXING_DEFAULT_SCALE, 1.0f);
|
scene.root()->scale_ = glm::vec3(MIXING_DEFAULT_SCALE, MIXING_DEFAULT_SCALE, 1.0f);
|
||||||
scene.root()->translation_ = glm::vec3(1.0f, 0.0f, 0.0f);
|
scene.root()->translation_ = glm::vec3(0.0f, 0.0f, 0.0f);
|
||||||
saveSettings();
|
saveSettings();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -280,6 +280,13 @@ MixingView::MixingView() : View(MIXING), limbo_scale_(1.3f)
|
|||||||
slider_->translation_ = glm::vec3(0.0f, 1.0f, 0.f);
|
slider_->translation_ = glm::vec3(0.0f, 1.0f, 0.f);
|
||||||
slider_->color = glm::vec4( COLOR_SLIDER_CIRCLE, 1.0f );
|
slider_->color = glm::vec4( COLOR_SLIDER_CIRCLE, 1.0f );
|
||||||
slider_root_->attach(slider_);
|
slider_root_->attach(slider_);
|
||||||
|
|
||||||
|
|
||||||
|
// stashCircle_ = new Disk();
|
||||||
|
// stashCircle_->scale_ = glm::vec3(0.5f, 0.5f, 1.f);
|
||||||
|
// stashCircle_->translation_ = glm::vec3(2.f, -1.0f, 0.f);
|
||||||
|
// stashCircle_->color = glm::vec4( COLOR_STASH_CIRCLE, 0.6f );
|
||||||
|
// scene.bg()->attach(stashCircle_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -303,7 +310,8 @@ void MixingView::zoom( float factor )
|
|||||||
|
|
||||||
void MixingView::resize ( int scale )
|
void MixingView::resize ( int scale )
|
||||||
{
|
{
|
||||||
float z = 0.01f * (float) scale;
|
float z = CLAMP(0.01f * (float) scale, 0.f, 1.f);
|
||||||
|
z *= z;
|
||||||
z *= MIXING_MAX_SCALE - MIXING_MIN_SCALE;
|
z *= MIXING_MAX_SCALE - MIXING_MIN_SCALE;
|
||||||
z += MIXING_MIN_SCALE;
|
z += MIXING_MIN_SCALE;
|
||||||
scene.root()->scale_.x = z;
|
scene.root()->scale_.x = z;
|
||||||
@@ -313,7 +321,7 @@ void MixingView::resize ( int scale )
|
|||||||
int MixingView::size ()
|
int MixingView::size ()
|
||||||
{
|
{
|
||||||
float z = (scene.root()->scale_.x - MIXING_MIN_SCALE) / (MIXING_MAX_SCALE - MIXING_MIN_SCALE);
|
float z = (scene.root()->scale_.x - MIXING_MIN_SCALE) / (MIXING_MAX_SCALE - MIXING_MIN_SCALE);
|
||||||
return (int) (z * 100.f);
|
return (int) ( sqrt(z) * 100.f);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MixingView::centerSource(Source *s)
|
void MixingView::centerSource(Source *s)
|
||||||
@@ -745,7 +753,8 @@ void GeometryView::zoom( float factor )
|
|||||||
|
|
||||||
void GeometryView::resize ( int scale )
|
void GeometryView::resize ( int scale )
|
||||||
{
|
{
|
||||||
float z = 0.01f * (float) scale;
|
float z = CLAMP(0.01f * (float) scale, 0.f, 1.f);
|
||||||
|
z *= z;
|
||||||
z *= GEOMETRY_MAX_SCALE - GEOMETRY_MIN_SCALE;
|
z *= GEOMETRY_MAX_SCALE - GEOMETRY_MIN_SCALE;
|
||||||
z += GEOMETRY_MIN_SCALE;
|
z += GEOMETRY_MIN_SCALE;
|
||||||
scene.root()->scale_.x = z;
|
scene.root()->scale_.x = z;
|
||||||
@@ -755,7 +764,7 @@ void GeometryView::resize ( int scale )
|
|||||||
int GeometryView::size ()
|
int GeometryView::size ()
|
||||||
{
|
{
|
||||||
float z = (scene.root()->scale_.x - GEOMETRY_MIN_SCALE) / (GEOMETRY_MAX_SCALE - GEOMETRY_MIN_SCALE);
|
float z = (scene.root()->scale_.x - GEOMETRY_MIN_SCALE) / (GEOMETRY_MAX_SCALE - GEOMETRY_MIN_SCALE);
|
||||||
return (int) (z * 100.f);
|
return (int) ( sqrt(z) * 100.f);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GeometryView::draw()
|
void GeometryView::draw()
|
||||||
@@ -1233,7 +1242,8 @@ void LayerView::zoom (float factor)
|
|||||||
|
|
||||||
void LayerView::resize ( int scale )
|
void LayerView::resize ( int scale )
|
||||||
{
|
{
|
||||||
float z = 0.01f * (float) scale;
|
float z = CLAMP(0.01f * (float) scale, 0.f, 1.f);
|
||||||
|
z *= z;
|
||||||
z *= LAYER_MAX_SCALE - LAYER_MIN_SCALE;
|
z *= LAYER_MAX_SCALE - LAYER_MIN_SCALE;
|
||||||
z += LAYER_MIN_SCALE;
|
z += LAYER_MIN_SCALE;
|
||||||
scene.root()->scale_.x = z;
|
scene.root()->scale_.x = z;
|
||||||
@@ -1243,7 +1253,7 @@ void LayerView::resize ( int scale )
|
|||||||
int LayerView::size ()
|
int LayerView::size ()
|
||||||
{
|
{
|
||||||
float z = (scene.root()->scale_.x - LAYER_MIN_SCALE) / (LAYER_MAX_SCALE - LAYER_MIN_SCALE);
|
float z = (scene.root()->scale_.x - LAYER_MIN_SCALE) / (LAYER_MAX_SCALE - LAYER_MIN_SCALE);
|
||||||
return (int) (z * 100.f);
|
return (int) ( sqrt(z) * 100.f);
|
||||||
}
|
}
|
||||||
|
|
||||||
float LayerView::setDepth(Source *s, float d)
|
float LayerView::setDepth(Source *s, float d)
|
||||||
|
|||||||
5
View.h
5
View.h
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
#include "Scene.h"
|
#include "Scene.h"
|
||||||
#include "FrameBuffer.h"
|
#include "FrameBuffer.h"
|
||||||
|
|
||||||
class Source;
|
class Source;
|
||||||
class SessionSource;
|
class SessionSource;
|
||||||
class Surface;
|
class Surface;
|
||||||
@@ -113,7 +114,11 @@ private:
|
|||||||
class Disk *slider_;
|
class Disk *slider_;
|
||||||
class Disk *button_white_;
|
class Disk *button_white_;
|
||||||
class Disk *button_black_;
|
class Disk *button_black_;
|
||||||
|
class Disk *stashCircle_;
|
||||||
class Mesh *mixingCircle_;
|
class Mesh *mixingCircle_;
|
||||||
|
|
||||||
|
|
||||||
|
// SourceList shash_;
|
||||||
};
|
};
|
||||||
|
|
||||||
class RenderView : public View
|
class RenderView : public View
|
||||||
|
|||||||
Reference in New Issue
Block a user