mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-20 14:49:59 +01:00
Improved slider Threshold
This commit is contained in:
@@ -383,13 +383,13 @@ void ImGuiVisitor::visit(ImageProcessingShader &n)
|
|||||||
/// THRESHOLD
|
/// THRESHOLD
|
||||||
///
|
///
|
||||||
ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN);
|
ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN);
|
||||||
float threshold = n.threshold < 0.001f ? 1.f : n.threshold;
|
float threshold = n.threshold < 0.001f ? 0.f : n.threshold;
|
||||||
if (ImGui::SliderFloat("##Threshold", &threshold, 1.f, 0.f, threshold > 0.999f ? "None" : "%.3f") ){
|
if (ImGui::SliderFloat("##Threshold", &threshold, 0.f, 1.f, threshold < 0.001f ? "None" : "%.3f") ){
|
||||||
n.threshold = threshold > 0.999f ? 0.f : threshold;
|
n.threshold = threshold < 0.001f ? 0.f : threshold;
|
||||||
}
|
}
|
||||||
if (ImGui::IsItemDeactivatedAfterEdit()){
|
if (ImGui::IsItemDeactivatedAfterEdit()){
|
||||||
oss << "Threshold ";
|
oss << "Threshold ";
|
||||||
if (n.threshold < 0.001) oss << "None"; else oss << std::setprecision(2) << n.threshold;
|
if (n.threshold < 0.001f) oss << "None"; else oss << std::setprecision(3) << n.threshold;
|
||||||
Action::manager().store(oss.str());
|
Action::manager().store(oss.str());
|
||||||
}
|
}
|
||||||
ImGui::SameLine(0, IMGUI_SAME_LINE);
|
ImGui::SameLine(0, IMGUI_SAME_LINE);
|
||||||
|
|||||||
Reference in New Issue
Block a user