FIX: the position of wipe tower is nor correct when multi-plate

Change-Id: Idabea67591102ee0f4595793e1ab027e805ace7a
This commit is contained in:
zhimin.zeng
2023-08-21 16:45:07 +08:00
committed by Lane.Wei
parent 7c89b4d225
commit 981a46920f
2 changed files with 13 additions and 4 deletions

View File

@@ -58,6 +58,9 @@ static const int PARTPLATE_TEXT_OFFSET_X1 = 3;
static const int PARTPLATE_TEXT_OFFSET_X2 = 1;
static const int PARTPLATE_TEXT_OFFSET_Y = 1;
static const int PARTPLATE_PLATENAME_OFFSET_Y = 10;
static const float WIPE_TOWER_DEFAULT_X_POS = 15.;
static const float WIPE_TOWER_DEFAULT_Y_POS = 220.;
std::array<unsigned char, 4> PlateTextureForeground = {0x0, 0xae, 0x42, 0xff};
namespace Slic3r {
@@ -3418,6 +3421,12 @@ int PartPlateList::create_plate(bool adjust_position)
ConfigOptionFloats* wipe_tower_y = proj_cfg.opt<ConfigOptionFloats>("wipe_tower_y");
wipe_tower_x->values.resize(m_plate_list.size(), wipe_tower_x->values.front());
wipe_tower_y->values.resize(m_plate_list.size(), wipe_tower_y->values.front());
// set the default position, the same with print config(left top)
ConfigOptionFloat wt_x_opt(WIPE_TOWER_DEFAULT_X_POS);
ConfigOptionFloat wt_y_opt(WIPE_TOWER_DEFAULT_Y_POS);
dynamic_cast<ConfigOptionFloats *>(proj_cfg.option("wipe_tower_x"))->set_at(&wt_x_opt, new_index, 0);
dynamic_cast<ConfigOptionFloats *>(proj_cfg.option("wipe_tower_y"))->set_at(&wt_y_opt, new_index, 0);
}
unprintable_plate.set_index(new_index+1);