FIX:scale and size sholud >0 in scale tool

jira: STUDIO-7433
Change-Id: Ibd4d00d9ca4762d002049e97a6d0819649f464db
(cherry picked from commit eaaf11031ee49009af14abbd05bb4a07c88aceda)
This commit is contained in:
zhou.xu 2024-06-21 12:55:23 +08:00 committed by Lane.Wei
parent 6e458699cf
commit 0d393d64b8

View File

@ -1017,7 +1017,9 @@ void GizmoObjectManipulation::do_render_scale_input_window(ImGuiWrapper* imgui_w
ImGui::BBLInputDouble(label_scale_values[0][2], &scale[2], 0.0f, 0.0f, "%.2f");
ImGui::SameLine(caption_max + (++index_unit) *unit_size + (++index) * space_size);
imgui_wrapper->text(_L("%"));
m_buffered_scale = scale;
if (scale.x() > 0 && scale.y() > 0 && scale.z() > 0) {
m_buffered_scale = scale;
}
if (m_show_clear_scale) {
ImGui::SameLine(caption_max + 3 * unit_size + 4 * space_size + end_text_size);
@ -1056,7 +1058,10 @@ void GizmoObjectManipulation::do_render_scale_input_window(ImGuiWrapper* imgui_w
{
if (std::abs(display_size[i]) > MAX_NUM) display_size[i] = MAX_NUM;
}
m_buffered_size = display_size;
if (display_size.x() > 0 && display_size.y() > 0 && display_size.z() > 0) {
m_buffered_size = display_size;
}
int size_sel = update(current_active_id, "size", original_size, m_buffered_size);
ImGui::PopStyleVar(1);