This commit is contained in:
bubnikv 2018-12-06 14:36:33 +01:00
commit c6ef194094
5 changed files with 19 additions and 22 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View file

@ -26,11 +26,7 @@
#include <wx/dcmemory.h>
#include <wx/image.h>
#include <wx/settings.h>
#if ENABLE_REMOVE_TABS_FROM_PLATER
#include <wx/tipwin.h>
#else
#include <wx/tooltip.h>
#endif // ENABLE_REMOVE_TABS_FROM_PLATER
#include <wx/debug.h>
// Print now includes tbb, and tbb includes Windows. This breaks compilation of wxWidgets if included before wx.
@ -1034,6 +1030,7 @@ GLCanvas3D::Mouse::Mouse()
, left_down(false)
, position(DBL_MAX, DBL_MAX)
, scene_position(DBL_MAX, DBL_MAX, DBL_MAX)
, ignore_up_event(false)
{
}
@ -4622,6 +4619,10 @@ void GLCanvas3D::on_mouse(wxMouseEvent& evt)
m_toolbar_action_running = true;
m_toolbar.do_action((unsigned int)toolbar_contains_mouse);
}
else if (evt.LeftDClick() && (m_gizmos.get_current_type() != Gizmos::Undefined))
{
m_mouse.ignore_up_event = true;
}
else if (evt.LeftDown() || evt.RightDown())
{
m_mouse.left_down = evt.LeftDown();
@ -4821,18 +4822,6 @@ void GLCanvas3D::on_mouse(wxMouseEvent& evt)
break;
}
// if (!volumes.empty())
// {
// BoundingBoxf3 bb;
// for (const GLVolume* volume : volumes)
// {
// bb.merge(volume->transformed_bounding_box());
// }
// const Vec3d& size = bb.size();
// const Vec3d& scale = m_gizmos.get_scale();
// post_event(Vec3dsEvent<2>(EVT_GLCANVAS_UPDATE_GEOMETRY, {size, scale}));
// }
m_dirty = true;
}
else if (evt.Dragging() && !gizmos_overlay_contains_mouse)
@ -4908,7 +4897,7 @@ void GLCanvas3D::on_mouse(wxMouseEvent& evt)
else if (evt.LeftUp() && !m_mouse.dragging && (m_hover_volume_id == -1) && !gizmos_overlay_contains_mouse && !m_gizmos.is_dragging() && !is_layers_editing_enabled())
{
// deselect and propagate event through callback
if (m_picking_enabled && !m_toolbar_action_running)
if (m_picking_enabled && !m_toolbar_action_running && !m_mouse.ignore_up_event)
{
m_selection.clear();
m_selection.set_mode(Selection::Instance);
@ -4916,6 +4905,7 @@ void GLCanvas3D::on_mouse(wxMouseEvent& evt)
post_event(SimpleEvent(EVT_GLCANVAS_OBJECT_SELECT));
_update_gizmos_data();
}
m_mouse.ignore_up_event = false;
}
else if (evt.LeftUp() && m_gizmos.is_dragging())
{

View file

@ -329,6 +329,7 @@ class GLCanvas3D
Vec2d position;
Vec3d scene_position;
Drag drag;
bool ignore_up_event;
Mouse();

View file

@ -854,7 +854,7 @@ void ObjectList::load_generic_subobject(const std::string& type_name, const int
new_volume->set_type(static_cast<ModelVolume::Type>(type));
#if ENABLE_MODELVOLUME_TRANSFORM
new_volume->set_offset((*m_objects)[obj_idx]->origin_translation + Vec3d(0.0, 0.0, -mesh.stl.stats.min(2)));
new_volume->set_offset(Vec3d(0.0, 0.0, (*m_objects)[obj_idx]->origin_translation(2) - mesh.stl.stats.min(2)));
new_volume->center_geometry();
#endif // ENABLE_MODELVOLUME_TRANSFORM

View file

@ -2112,14 +2112,20 @@ void Plater::priv::set_current_panel(wxPanel* panel)
return;
current_panel = panel;
// to reduce flickering when changing view, first set as visible the new current panel
for (wxPanel* p : panels)
{
p->Show(p == current_panel);
if (p == current_panel)
p->Show();
}
// then set to invisible the other
for (wxPanel* p : panels)
{
if (p != current_panel)
p->Hide();
}
q->Freeze();
panel_sizer->Layout();
q->Thaw();
if (current_panel == view3D)
{
@ -2479,7 +2485,7 @@ bool Plater::priv::init_object_menu()
#if ENABLE_REMOVE_TABS_FROM_PLATER
void Plater::priv::init_view_toolbar()
{
if (!view_toolbar.init("view_toolbar.png", 36, 1, 1))
if (!view_toolbar.init("view_toolbar.png", 64, 0, 0))
return;
GLRadioToolbarItem::Data item;