FIX: ban shift function on paint mode

Jira: STUDIO-6138
Change-Id: Idd107614c827d318fc90810201de8eea2fbf4a92
This commit is contained in:
zhou.xu 2024-01-30 17:15:15 +08:00 committed by Lane.Wei
parent b98992cdb6
commit d9371e40c1
4 changed files with 26 additions and 4 deletions

View File

@ -210,8 +210,8 @@ namespace ImGui
const wchar_t AddFilamentIcon = 0x0844;
const wchar_t AddFilamentDarkIcon = 0x0845;
const wchar_t DeleteFilamentIcon = 0x0845;
const wchar_t DeleteFilamentDarkIcon = 0x0846;
const wchar_t DeleteFilamentIcon = 0x0846;
const wchar_t DeleteFilamentDarkIcon = 0x0847;
// void MyFunction(const char* name, const MyMatrix44& v);
}

View File

@ -139,8 +139,14 @@ ObjectList::ObjectList(wxWindow* parent) :
// Workaround for entering the column editing mode on Windows. Simulate keyboard enter when another column of the active line is selected.
int new_selected_column = -1;
#endif //__WXMSW__
if (wxGetKeyState(WXK_SHIFT))
{
if (wxGetKeyState(WXK_SHIFT)) {
GLGizmosManager &gizmos_mgr = wxGetApp().plater()->get_view3D_canvas3D()->get_gizmos_manager();
if (gizmos_mgr.is_gizmo_activable_when_single_full_instance()) {
// selection will not be single_full_instance after shift_pressed,Caused exe crashed
UnselectAll();
Select(m_last_selected_item);
return;
}
wxDataViewItemArray sels;
GetSelections(sels);
if (! sels.empty() && sels.front() == m_last_selected_item)

View File

@ -631,6 +631,21 @@ void GLGizmosManager::set_painter_gizmo_data()
dynamic_cast<GLGizmoMmuSegmentation*>(m_gizmos[MmuSegmentation].get())->set_painter_gizmo_data(m_parent.get_selection());
}
bool GLGizmosManager::is_gizmo_activable_when_single_full_instance() {
if (get_current_type() == GLGizmosManager::EType::Flatten ||
get_current_type() == GLGizmosManager::EType::Cut ||
get_current_type() == GLGizmosManager::EType::MeshBoolean ||
get_current_type() == GLGizmosManager::EType::Text ||
get_current_type() == GLGizmosManager::EType::Seam ||
get_current_type() == GLGizmosManager::EType::FdmSupports ||
get_current_type() == GLGizmosManager::EType::MmuSegmentation ||
get_current_type() == GLGizmosManager::EType::Simplify
) {
return true;
}
return false;
}
// Returns true if the gizmo used the event to do something, false otherwise.
bool GLGizmosManager::gizmo_event(SLAGizmoEventType action, const Vec2d& mouse_position, bool shift_down, bool alt_down, bool control_down)
{

View File

@ -276,6 +276,7 @@ public:
void set_painter_gizmo_data();
bool is_gizmo_activable_when_single_full_instance();
bool gizmo_event(SLAGizmoEventType action, const Vec2d& mouse_position = Vec2d::Zero(), bool shift_down = false, bool alt_down = false, bool control_down = false);
ClippingPlane get_clipping_plane() const;
ClippingPlane get_assemble_view_clipping_plane() const;