mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-07-18 13:54:29 +08:00
Disable move of text out of object surface
This commit is contained in:
parent
99d4884074
commit
a32b2764c6
@ -490,25 +490,21 @@ bool GLGizmoEmboss::on_mouse_for_translate(const wxMouseEvent &mouse_event)
|
|||||||
m_raycast_manager.actualize(act_model_object, &condition);
|
m_raycast_manager.actualize(act_model_object, &condition);
|
||||||
m_dragging_mouse_offset = priv::calc_mouse_to_center_text_offset(mouse_pos, *m_volume);
|
m_dragging_mouse_offset = priv::calc_mouse_to_center_text_offset(mouse_pos, *m_volume);
|
||||||
// Cancel job to prevent interuption of dragging (duplicit result)
|
// Cancel job to prevent interuption of dragging (duplicit result)
|
||||||
if (m_update_job_cancel != nullptr) m_update_job_cancel->store(true);
|
if (m_update_job_cancel != nullptr)
|
||||||
|
m_update_job_cancel->store(true);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Dragging starts out of window
|
// Dragging starts out of window
|
||||||
if (!m_dragging_mouse_offset.has_value()) return false;
|
if (!m_dragging_mouse_offset.has_value())
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (mouse_event.Dragging()) {
|
||||||
const Camera &camera = wxGetApp().plater()->get_camera();
|
const Camera &camera = wxGetApp().plater()->get_camera();
|
||||||
Vec2d offseted_mouse = mouse_pos + *m_dragging_mouse_offset;
|
Vec2d offseted_mouse = mouse_pos + *m_dragging_mouse_offset;
|
||||||
auto hit = m_raycast_manager.unproject(offseted_mouse, camera, &condition);
|
auto hit = m_raycast_manager.unproject(offseted_mouse, camera, &condition);
|
||||||
if (!hit.has_value()) {
|
if (!hit.has_value())
|
||||||
// there is no hit
|
|
||||||
// show common translation of object
|
|
||||||
m_parent.toggle_model_objects_visibility(true);
|
|
||||||
m_temp_transformation = {};
|
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
|
|
||||||
if (mouse_event.Dragging()) {
|
|
||||||
TextConfiguration &tc = *m_volume->text_configuration;
|
TextConfiguration &tc = *m_volume->text_configuration;
|
||||||
// hide common dragging of object
|
// hide common dragging of object
|
||||||
m_parent.toggle_model_objects_visibility(false, m_volume->get_object(), gl_volume->instance_idx(), m_volume);
|
m_parent.toggle_model_objects_visibility(false, m_volume->get_object(), gl_volume->instance_idx(), m_volume);
|
||||||
@ -2904,9 +2900,14 @@ void GLGizmoEmboss::draw_advanced()
|
|||||||
if (rev_checkbox(tr.use_surface, font_prop.use_surface, def_use_surface,
|
if (rev_checkbox(tr.use_surface, font_prop.use_surface, def_use_surface,
|
||||||
_u8L("Revert using of model surface."))) {
|
_u8L("Revert using of model surface."))) {
|
||||||
if (font_prop.use_surface) {
|
if (font_prop.use_surface) {
|
||||||
|
// when using surface distance is not used
|
||||||
font_prop.distance.reset();
|
font_prop.distance.reset();
|
||||||
|
|
||||||
|
// there should be minimal embossing depth
|
||||||
if (font_prop.emboss < 0.1)
|
if (font_prop.emboss < 0.1)
|
||||||
font_prop.emboss = 1;
|
font_prop.emboss = 1;
|
||||||
|
|
||||||
|
// TODO: project an origin on surface
|
||||||
}
|
}
|
||||||
process();
|
process();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user