mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-06 22:47:32 -06:00
Set MAX_FLUSH_VALUE to maximum possible value
"Insanely high value that still plays nicely when converting between int and float (because it's internally stored in m_matrix as floats). 2147483520 (which is ~2 cubic meters) is the max value that can be saved properly in this case."
This commit is contained in:
parent
dd4a3ec042
commit
7a50acb607
1 changed files with 7 additions and 1 deletions
|
@ -34,6 +34,7 @@ static const wxColour g_text_color = wxColour(107, 107, 107, 255);
|
||||||
#define BTN_SIZE wxSize(FromDIP(58), FromDIP(24))
|
#define BTN_SIZE wxSize(FromDIP(58), FromDIP(24))
|
||||||
#define BTN_GAP FromDIP(20)
|
#define BTN_GAP FromDIP(20)
|
||||||
#define TEXT_BEG_PADDING FromDIP(30)
|
#define TEXT_BEG_PADDING FromDIP(30)
|
||||||
|
#define MAX_FLUSH_VALUE 2147483520
|
||||||
#define MIN_WIPING_DIALOG_WIDTH FromDIP(300)
|
#define MIN_WIPING_DIALOG_WIDTH FromDIP(300)
|
||||||
#define TIP_MESSAGES_PADDING FromDIP(8)
|
#define TIP_MESSAGES_PADDING FromDIP(8)
|
||||||
|
|
||||||
|
@ -497,7 +498,12 @@ WipingPanel::WipingPanel(wxWindow* parent, const std::vector<float>& matrix, con
|
||||||
edit_boxes[i][j]->Bind(wxEVT_TEXT, [this, i, j](wxCommandEvent& e) {
|
edit_boxes[i][j]->Bind(wxEVT_TEXT, [this, i, j](wxCommandEvent& e) {
|
||||||
wxString str = edit_boxes[i][j]->GetValue();
|
wxString str = edit_boxes[i][j]->GetValue();
|
||||||
int value = wxAtoi(str);
|
int value = wxAtoi(str);
|
||||||
if (value < 0) {
|
|
||||||
|
if (value > MAX_FLUSH_VALUE) {
|
||||||
|
str = wxString::Format(("%d"), MAX_FLUSH_VALUE);
|
||||||
|
edit_boxes[i][j]->SetValue(str);
|
||||||
|
}
|
||||||
|
else if (value < 0) {
|
||||||
edit_boxes[i][j]->SetValue(wxString("0"));
|
edit_boxes[i][j]->SetValue(wxString("0"));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue