Merge remote-tracking branch 'origin/master' into ys_color_print_extension

This commit is contained in:
YuSanka 2019-10-10 16:17:09 +02:00
commit 5d9a136b8a
12 changed files with 319 additions and 207 deletions

View file

@ -107,7 +107,9 @@ void GLCanvas3DManager::GLInfo::detect() const
m_renderer = data;
glsafe(::glGetIntegerv(GL_MAX_TEXTURE_SIZE, &m_max_tex_size));
m_max_tex_size /= 2;
if (GLEW_EXT_texture_filter_anisotropic)
glsafe(::glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &m_max_anisotropy));

View file

@ -2331,6 +2331,7 @@ void ObjectList::changed_object(const int obj_idx/* = -1*/) const
void ObjectList::part_selection_changed()
{
if (m_extruder_editor) m_extruder_editor->Hide();
int obj_idx = -1;
int volume_id = -1;
m_config = nullptr;
@ -2954,7 +2955,6 @@ int ObjectList::get_selected_layers_range_idx() const
void ObjectList::update_selections()
{
if (m_extruder_editor) m_extruder_editor->Hide();
const Selection& selection = wxGetApp().plater()->canvas3D()->get_selection();
wxDataViewItemArray sels;

View file

@ -417,6 +417,9 @@ bool GLGizmosManager::on_mouse_wheel(wxMouseEvent& evt)
bool GLGizmosManager::on_mouse(wxMouseEvent& evt)
{
// used to set a right up event as processed when needed
static bool pending_right_up = false;
Point pos(evt.GetX(), evt.GetY());
Vec2d mouse_pos((double)evt.GetX(), (double)evt.GetY());
@ -442,7 +445,14 @@ bool GLGizmosManager::on_mouse(wxMouseEvent& evt)
else if (evt.MiddleUp())
m_mouse_capture.middle = false;
else if (evt.RightUp())
{
m_mouse_capture.right = false;
if (pending_right_up)
{
pending_right_up = false;
processed = true;
}
}
else if (evt.Dragging() && m_mouse_capture.any())
// if the button down was done on this toolbar, prevent from dragging into the scene
processed = true;
@ -473,8 +483,12 @@ bool GLGizmosManager::on_mouse(wxMouseEvent& evt)
}
}
else if (evt.RightDown() && (selected_object_idx != -1) && (m_current == SlaSupports) && gizmo_event(SLAGizmoEventType::RightDown))
{
// we need to set the following right up as processed to avoid showing the context menu if the user release the mouse over the object
pending_right_up = true;
// event was taken care of by the SlaSupports gizmo
processed = true;
}
else if (evt.Dragging() && (m_parent.get_move_volume_id() != -1) && (m_current == SlaSupports))
// don't allow dragging objects with the Sla gizmo on
processed = true;

View file

@ -3837,9 +3837,9 @@ bool Plater::priv::can_reload_from_disk() const
for (unsigned int idx : selected_volumes_idxs)
{
const GLVolume* v = selection.get_volume(idx);
int o_idx = v->object_idx();
int v_idx = v->volume_idx();
selected_volumes.push_back({ o_idx, v_idx });
if (v_idx >= 0)
selected_volumes.push_back({ v->object_idx(), v_idx });
}
std::sort(selected_volumes.begin(), selected_volumes.end());
selected_volumes.erase(std::unique(selected_volumes.begin(), selected_volumes.end()), selected_volumes.end());

View file

@ -2179,7 +2179,12 @@ wxWindow* BitmapChoiceRenderer::CreateEditorCtrl(wxWindow* parent, wxRect labelR
c_editor->SetSelection(atoi(data.GetText().c_str()));
// to avoid event propagation to other sidebar items
c_editor->Bind(wxEVT_COMBOBOX, [](wxCommandEvent& evt) { evt.StopPropagation(); });
c_editor->Bind(wxEVT_COMBOBOX, [this](wxCommandEvent& evt) {
evt.StopPropagation();
// FinishEditing grabs new selection and triggers config update. We better call
// it explicitly, automatic update on KILL_FOCUS didn't work on Linux.
this->FinishEditing();
});
return c_editor;
}