FIX: the text position is not correct

Change-Id: Icade50bd8246d051f6c8368f2be89654cb96c9d9
(cherry picked from commit a39d7ffb377c53aa85264e8196e47b176479544a)
This commit is contained in:
zhimin.zeng 2023-01-05 14:04:36 +08:00 committed by Lane.Wei
parent a4cf284c3d
commit 49673b56e3
1 changed files with 2 additions and 2 deletions

View File

@ -2179,9 +2179,9 @@ void ObjectList::load_mesh_part(const TriangleMesh &mesh, const wxString &name,
// apply the instance transform to all volumes and reset instance transform except the offset
apply_object_instance_transfrom_to_all_volumes(mo);
double old_top_position = mo->mesh().bounding_box().max(2) - mo->instances[0]->get_offset().z();
ModelVolume* mv = mo->add_volume(mesh);
Vec3d instance_bbox = mo->mesh().bounding_box().size();
Vec3d offset = Vec3d(0, 0, instance_bbox[2] / 2 + mv->get_offset(Axis::Z));
Vec3d offset = Vec3d(0, 0, old_top_position + mv->get_offset(Axis::Z));
mv->set_offset(offset);
mv->name = name.ToStdString();
if (!text_info.m_text.empty())