Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/supermerill/SuperSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEnrico Turri <enricoturri@seznam.cz>2019-04-25 10:46:26 +0300
committerEnrico Turri <enricoturri@seznam.cz>2019-04-25 10:46:26 +0300
commit11490dfb066e56829a6a11d63d29cde7d0956846 (patch)
tree9ae694cc38cf5137c9a3cdf9f3b961675a038537 /src/slic3r/GUI/3DScene.cpp
parentec2f319a3d7cce7958a750e142d06c3921e7bf84 (diff)
Rectangle selection in 3D scene -> hovering detection
Diffstat (limited to 'src/slic3r/GUI/3DScene.cpp')
-rw-r--r--src/slic3r/GUI/3DScene.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/slic3r/GUI/3DScene.cpp b/src/slic3r/GUI/3DScene.cpp
index 9038e388c..9d1407b00 100644
--- a/src/slic3r/GUI/3DScene.cpp
+++ b/src/slic3r/GUI/3DScene.cpp
@@ -223,7 +223,8 @@ void GLIndexedVertexArray::render(
}
const float GLVolume::SELECTED_COLOR[4] = { 0.0f, 1.0f, 0.0f, 1.0f };
-const float GLVolume::HOVER_COLOR[4] = { 0.4f, 0.9f, 0.1f, 1.0f };
+const float GLVolume::HOVER_SELECT_COLOR[4] = { 0.4f, 0.9f, 0.1f, 1.0f };
+const float GLVolume::HOVER_DESELECT_COLOR[4] = { 0.9f, 0.4f, 0.1f, 1.0f };
const float GLVolume::OUTSIDE_COLOR[4] = { 0.0f, 0.38f, 0.8f, 1.0f };
const float GLVolume::SELECTED_OUTSIDE_COLOR[4] = { 0.19f, 0.58f, 1.0f, 1.0f };
const float GLVolume::DISABLED_COLOR[4] = { 0.25f, 0.25f, 0.25f, 1.0f };
@@ -251,7 +252,8 @@ GLVolume::GLVolume(float r, float g, float b, float a)
, zoom_to_volumes(true)
, shader_outside_printer_detection_enabled(false)
, is_outside(false)
- , hover(false)
+ , hover_select(false)
+ , hover_deselect(false)
, is_modifier(false)
, is_wipe_tower(false)
, is_extrusion_path(false)
@@ -291,10 +293,12 @@ void GLVolume::set_render_color()
if (force_native_color)
set_render_color(color, 4);
else {
- if (selected)
+ if (hover_select)
+ set_render_color(HOVER_SELECT_COLOR, 4);
+ else if (hover_deselect)
+ set_render_color(HOVER_DESELECT_COLOR, 4);
+ else if (selected)
set_render_color(is_outside ? SELECTED_OUTSIDE_COLOR : SELECTED_COLOR, 4);
- else if (hover)
- set_render_color(HOVER_COLOR, 4);
else if (disabled)
set_render_color(DISABLED_COLOR, 4);
else if (is_outside && shader_outside_printer_detection_enabled)