|
@@ -114,7 +114,9 @@ IGL_INLINE bool ImGuiMenu::mouse_down(int button, int modifier)
|
|
|
|
|
|
IGL_INLINE bool ImGuiMenu::mouse_up(int button, int modifier)
|
|
|
{
|
|
|
- return ImGui::GetIO().WantCaptureMouse;
|
|
|
+ //return ImGui::GetIO().WantCaptureMouse;
|
|
|
+ // !! Should not steal mouse up
|
|
|
+ return false;
|
|
|
}
|
|
|
|
|
|
IGL_INLINE bool ImGuiMenu::mouse_move(int mouse_x, int mouse_y)
|
|
@@ -336,7 +338,11 @@ IGL_INLINE void ImGuiMenu::draw_labels(const igl::opengl::ViewerData &data)
|
|
|
{
|
|
|
for (int i = 0; i < data.V.rows(); ++i)
|
|
|
{
|
|
|
- draw_text(data.V.row(i), data.V_normals.row(i), std::to_string(i));
|
|
|
+ draw_text(
|
|
|
+ data.V.row(i),
|
|
|
+ data.V_normals.row(i),
|
|
|
+ std::to_string(i),
|
|
|
+ data.label_color);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -351,7 +357,11 @@ IGL_INLINE void ImGuiMenu::draw_labels(const igl::opengl::ViewerData &data)
|
|
|
}
|
|
|
p /= (double) data.F.cols();
|
|
|
|
|
|
- draw_text(p, data.F_normals.row(i), std::to_string(i));
|
|
|
+ draw_text(
|
|
|
+ p,
|
|
|
+ data.F_normals.row(i),
|
|
|
+ std::to_string(i),
|
|
|
+ data.label_color);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -359,13 +369,20 @@ IGL_INLINE void ImGuiMenu::draw_labels(const igl::opengl::ViewerData &data)
|
|
|
{
|
|
|
for (int i = 0; i < data.labels_positions.rows(); ++i)
|
|
|
{
|
|
|
- draw_text(data.labels_positions.row(i), Eigen::Vector3d(0.0,0.0,0.0),
|
|
|
- data.labels_strings[i]);
|
|
|
+ draw_text(
|
|
|
+ data.labels_positions.row(i),
|
|
|
+ Eigen::Vector3d(0.0,0.0,0.0),
|
|
|
+ data.labels_strings[i],
|
|
|
+ data.label_color);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-IGL_INLINE void ImGuiMenu::draw_text(Eigen::Vector3d pos, Eigen::Vector3d normal, const std::string &text)
|
|
|
+IGL_INLINE void ImGuiMenu::draw_text(
|
|
|
+ Eigen::Vector3d pos,
|
|
|
+ Eigen::Vector3d normal,
|
|
|
+ const std::string &text,
|
|
|
+ const Eigen::Vector4f color)
|
|
|
{
|
|
|
pos += normal * 0.005f * viewer->core().object_scale;
|
|
|
Eigen::Vector3f coord = igl::project(Eigen::Vector3f(pos.cast<float>()),
|
|
@@ -375,7 +392,11 @@ IGL_INLINE void ImGuiMenu::draw_text(Eigen::Vector3d pos, Eigen::Vector3d normal
|
|
|
ImDrawList* drawList = ImGui::GetWindowDrawList();
|
|
|
drawList->AddText(ImGui::GetFont(), ImGui::GetFontSize() * 1.2,
|
|
|
ImVec2(coord[0]/pixel_ratio_, (viewer->core().viewport[3] - coord[1])/pixel_ratio_),
|
|
|
- ImGui::GetColorU32(ImVec4(0, 0, 10, 255)),
|
|
|
+ ImGui::GetColorU32(ImVec4(
|
|
|
+ color(0),
|
|
|
+ color(1),
|
|
|
+ color(2),
|
|
|
+ color(3))),
|
|
|
&text[0], &text[0] + text.size());
|
|
|
}
|
|
|
|