FIX: Text dragging of special file doesn't work

Jira: 4271
Change-Id: I0b2e33ac0cf4919bea93732151529deac3b7e9ed
(cherry picked from commit f1534363d63c5f8b8ddb00edb8edef6b0376b54d)
This commit is contained in:
zhimin.zeng 2023-08-30 16:01:57 +08:00 committed by Lane.Wei
parent b0e20ad68e
commit f78b067525

View file

@ -1002,8 +1002,9 @@ bool GLGizmoText::update_text_positions(const std::vector<std::string>& texts)
Vec3d temp_position = m_mouse_position_world;
Vec3d temp_normal = m_mouse_normal_world;
Vec3d cut_plane = Vec3d::UnitY();
if (temp_normal != Vec3d::UnitZ()) {
Vec3d cut_plane = Vec3d::UnitY();
double epson = 1e-6;
if (!(abs(temp_normal.x()) <= epson && abs(temp_normal.y()) <= epson && abs(temp_normal.z()) > epson)) { // temp_normal != Vec3d::UnitZ()
Vec3d v_plane = temp_normal.cross(Vec3d::UnitZ());
cut_plane = v_plane.cross(temp_normal);
}
@ -1092,6 +1093,9 @@ bool GLGizmoText::update_text_positions(const std::vector<std::string>& texts)
MeshSlicingParams slicing_params;
slicing_params.trafo = transfo * mi->get_transformation().get_matrix() /** volume->get_transformation().get_matrix()*/;
// for debug
// its_write_obj(slice_meshs.its, "D:/debug_files/mesh.obj");
// generate polygons
const Polygons temp_polys = slice_mesh(slice_meshs.its, click_point.z(), slicing_params);