forked from bartvdbraak/blender
Python ui: increase interface float precision limit from 6 to 7
This commit is contained in:
parent
bd17d2371f
commit
1cf1984d1c
@ -78,7 +78,7 @@
|
|||||||
|
|
||||||
#include "interface_intern.h"
|
#include "interface_intern.h"
|
||||||
|
|
||||||
#define PRECISION_FLOAT_MAX 6
|
#define PRECISION_FLOAT_MAX 7
|
||||||
#define PRECISION_FLOAT_MAX_POW 1000000 /* pow(10, PRECISION_FLOAT_MAX) */
|
#define PRECISION_FLOAT_MAX_POW 1000000 /* pow(10, PRECISION_FLOAT_MAX) */
|
||||||
|
|
||||||
/* avoid unneeded calls to ui_get_but_val */
|
/* avoid unneeded calls to ui_get_but_val */
|
||||||
@ -443,7 +443,7 @@ void uiExplicitBoundsBlock(uiBlock *block, int minx, int miny, int maxx, int max
|
|||||||
static int ui_but_float_precision(uiBut *but, double value)
|
static int ui_but_float_precision(uiBut *but, double value)
|
||||||
{
|
{
|
||||||
int prec;
|
int prec;
|
||||||
const double pow10_neg[PRECISION_FLOAT_MAX + 1] = {1.0, 0.1, 0.01, 0.001, 0.0001, 0.00001, 0.000001};
|
const double pow10_neg[PRECISION_FLOAT_MAX + 1] = {1.0, 0.1, 0.01, 0.001, 0.0001, 0.00001, 0.000001, 0.0000001};
|
||||||
|
|
||||||
/* first check if prec is 0 and fallback to a simple default */
|
/* first check if prec is 0 and fallback to a simple default */
|
||||||
if ((prec = (int)but->a2) == -1) {
|
if ((prec = (int)but->a2) == -1) {
|
||||||
|
Loading…
Reference in New Issue
Block a user