mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-01-31 19:29:18 +00:00
four digits shown in pen width
This commit is contained in:
parent
dd108cde6b
commit
04cc9300bf
@ -577,7 +577,7 @@ namespace dialog {
|
||||
if(ne.positive && x <= 0) return;
|
||||
*ne.editwhat = x;
|
||||
}
|
||||
if(kind == 'v') ne.s = fts(*ne.editwhat);
|
||||
if(kind == 'v') ne.s = disp(*ne.editwhat);
|
||||
}
|
||||
|
||||
if(reaction) reaction();
|
||||
@ -758,7 +758,7 @@ namespace dialog {
|
||||
double d = exp(shiftmul/10);
|
||||
vid.alpha *= d;
|
||||
vid.scale *= d;
|
||||
ne.s = fts(vid.alpha);
|
||||
ne.s = disp(vid.alpha);
|
||||
}
|
||||
else if(doexiton(sym, uni)) popScreen();
|
||||
};
|
||||
@ -815,7 +815,7 @@ namespace dialog {
|
||||
|
||||
void editNumber(ld& x, ld vmin, ld vmax, ld step, ld dft, string title, string help) {
|
||||
ne.editwhat = &x;
|
||||
ne.s = fts(x);
|
||||
ne.s = disp(x);
|
||||
ne.vmin = vmin;
|
||||
ne.vmax = vmax;
|
||||
ne.step = step;
|
||||
|
23
util.cpp
23
util.cpp
@ -16,6 +16,29 @@ string ftssmart(ld x) {
|
||||
return buf;
|
||||
}
|
||||
|
||||
/*
|
||||
string fts_smartdisplay(ld x, int maxdisplay) {
|
||||
string rv;
|
||||
if(x > 1e9 || x < -1e9) retrun fts(x);
|
||||
if(x<0) { rv = "-"; x = -x; }
|
||||
int i = int(x);
|
||||
rv += its(i);
|
||||
x -= i;
|
||||
bool nonzero = i;
|
||||
if(x == 0) return rv;
|
||||
if(x < 1e-9 && nonzero) return rv;
|
||||
rv += ".";
|
||||
while(maxdisplay > 0) {
|
||||
x *= 10;
|
||||
rv += '0' + int(x);
|
||||
if(int(x)) nonzero = true;
|
||||
x -= int(x);
|
||||
if(x == 0) return rv;
|
||||
if(x < 1e-9 && nonzero) return rv;
|
||||
maxdisplay--;
|
||||
}
|
||||
} */
|
||||
|
||||
string cts(char c) { char buf[8]; buf[0] = c; buf[1] = 0; return buf; }
|
||||
string llts(long long i) {
|
||||
// sprintf does not work on Windows IIRC
|
||||
|
Loading…
Reference in New Issue
Block a user