mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-14 23:55:59 +08:00
MenuFactory: SLA specific: Fixed adding of the "Edit text" menu item
This commit is contained in:
parent
7b207aaf5c
commit
0dadde6ae3
@ -1018,16 +1018,19 @@ void MenuFactory::append_menu_item_edit_text(wxMenu *menu)
|
|||||||
wxString name = _L("Edit text");
|
wxString name = _L("Edit text");
|
||||||
|
|
||||||
auto can_edit_text = []() {
|
auto can_edit_text = []() {
|
||||||
const auto& sel = plater()->get_selection();
|
if (plater() != nullptr) {
|
||||||
if (sel.volumes_count() != 1) return false;
|
const Selection& sel = plater()->get_selection();
|
||||||
auto cid = sel.get_volume(*sel.get_volume_idxs().begin());
|
if (sel.volumes_count() == 1) {
|
||||||
const ModelVolume* vol = plater()->canvas3D()->get_model()
|
const GLVolume* gl_vol = sel.get_first_volume();
|
||||||
->objects[cid->object_idx()]->volumes[cid->volume_idx()];
|
const ModelVolume* vol = plater()->model().objects[gl_vol->object_idx()]->volumes[gl_vol->volume_idx()];
|
||||||
return vol->text_configuration.has_value();
|
return vol->text_configuration.has_value();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
if (menu == &m_object_menu) {
|
if (menu != &m_text_part_menu) {
|
||||||
auto menu_item_id = menu->FindItem(name);
|
const int menu_item_id = menu->FindItem(name);
|
||||||
if (menu_item_id != wxNOT_FOUND)
|
if (menu_item_id != wxNOT_FOUND)
|
||||||
menu->Destroy(menu_item_id);
|
menu->Destroy(menu_item_id);
|
||||||
if (!can_edit_text())
|
if (!can_edit_text())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user