mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-14 00:52:04 +00:00
Remove range checks for bed_exclude_area and never used printable_area checks (#11877)
# Description <!-- > Please provide a summary of the changes made in this PR. Include details such as: > * What issue does this PR address or fix? > * What new features or enhancements does this PR introduce? > * Are there any breaking changes or dependencies that need to be considered? --> # Screenshots/Recordings/Graphs <!-- > Please attach relevant screenshots to showcase the UI changes. > Please attach images that can help explain the changes. --> ## Tests <!-- > Please describe the tests that you have conducted to verify the changes made in this PR. -->
This commit is contained in:
@@ -511,7 +511,6 @@ void Field::get_value_by_opt_type(wxString& str, const bool check_value/* = true
|
||||
str.Replace(" ", wxEmptyString, true);
|
||||
if (!str.IsEmpty()) {
|
||||
bool invalid_val = false;
|
||||
bool out_of_range_val = false;
|
||||
wxStringTokenizer thumbnails(str, ",");
|
||||
while (thumbnails.HasMoreTokens()) {
|
||||
wxString token = thumbnails.GetNextToken();
|
||||
@@ -522,26 +521,8 @@ void Field::get_value_by_opt_type(wxString& str, const bool check_value/* = true
|
||||
if (x_str.ToDouble(&x) && thumbnail.HasMoreTokens()) {
|
||||
wxString y_str = thumbnail.GetNextToken();
|
||||
if (y_str.ToDouble(&y) && !thumbnail.HasMoreTokens()) {
|
||||
if (m_opt_id == "bed_exclude_area") {
|
||||
if (0 <= x && x <= 350 && 0 <= y && y <= 350) {
|
||||
out_values.push_back(Vec2d(x, y));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else if (m_opt_id == "printable_area") {
|
||||
if (0 <= x && x <= 1000 && 0 <= y && y <= 1000) {
|
||||
out_values.push_back(Vec2d(x, y));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (0 < x && x < 1000 && 0 < y && y < 1000) {
|
||||
out_values.push_back(Vec2d(x, y));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
out_of_range_val = true;
|
||||
break;
|
||||
out_values.push_back(Vec2d(x, y));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -549,14 +530,7 @@ void Field::get_value_by_opt_type(wxString& str, const bool check_value/* = true
|
||||
break;
|
||||
}
|
||||
|
||||
if (out_of_range_val) {
|
||||
wxString text_value;
|
||||
if (!m_value.empty())
|
||||
text_value = get_thumbnails_string(boost::any_cast<std::vector<Vec2d>>(m_value));
|
||||
set_value(text_value, true);
|
||||
show_error(m_parent, _L("Value is out of range."));
|
||||
}
|
||||
else if (invalid_val) {
|
||||
if (invalid_val) {
|
||||
wxString text_value;
|
||||
if (!m_value.empty())
|
||||
text_value = get_thumbnails_string(boost::any_cast<std::vector<Vec2d>>(m_value));
|
||||
|
||||
Reference in New Issue
Block a user