mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-09-27 19:01:02 +00:00
Fix float number not working properly for option min/max (#11211)
* ConfigOptionDef: min/max values type are changed from INT to FLOAT. (cherry picked from commit f277bc80c22e0c9a067481a4301922e2c96aed47) * Fix infinite loop and crash when `fuzzy_skin_point_distance` = 0 (SoftFever/OrcaSlicer#11069) * Fix Linux build issue * Fix float comparison due to precision loss
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
#include <assert.h>
|
||||
#include <map>
|
||||
#include <climits>
|
||||
#include <cfloat>
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
#include <functional>
|
||||
@@ -2455,10 +2456,11 @@ public:
|
||||
// Optional width of an input field.
|
||||
int width = -1;
|
||||
// <min, max> limit of a numeric input.
|
||||
// If not set, the <min, max> is set to <INT_MIN, INT_MAX>
|
||||
// If not set, the <min, max> is set to <-FLT_MAX, FLT_MAX>
|
||||
// By setting min=0, only nonnegative input is allowed.
|
||||
int min = INT_MIN;
|
||||
int max = INT_MAX;
|
||||
float min = -FLT_MAX;
|
||||
float max = FLT_MAX;
|
||||
bool is_value_valid(double value, int max_precision = 4) const;
|
||||
// To check if it's not a typo and a % is missing
|
||||
double max_literal = 1;
|
||||
ConfigOptionMode mode = comSimple;
|
||||
|
||||
Reference in New Issue
Block a user