From a7e1418ffdad813ecfaf42ed2b7bca45d086ee56 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Wed, 3 Jul 2019 04:55:27 +0200 Subject: [PATCH] scaleSinh100, used in IPD config --- config.cpp | 2 +- hyper.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/config.cpp b/config.cpp index 038c2ed2..9b9e784f 100644 --- a/config.cpp +++ b/config.cpp @@ -1221,7 +1221,7 @@ void showStereo() { dialog::editNumber(vid.ipd, -10, 10, 0.01, 0, XLAT("pupillary distance"), help3 + XLAT("The distance between your eyes in the represented 3D object. This is given in absolute units.") - ); + ), dialog::scaleSinh100(); else if(uni == 'd' && vid.stereo_mode == sAnaglyph) dialog::editNumber(vid.anaglyph_eyewidth, -1, 1, 0.01, 0, XLAT("distance between images"), diff --git a/hyper.h b/hyper.h index c0a68d10..9ae360e3 100644 --- a/hyper.h +++ b/hyper.h @@ -1937,6 +1937,7 @@ namespace dialog { const static scaler identity = {identity_f, identity_f, false}; const static scaler logarithmic = {log, exp, true}; const static scaler asinhic = {asinh, sinh, false}; + const static scaler asinhic100 = {[] (ld x) { return asinh(x*100); }, [] (ld x) { return sinh(x)/100; }, false}; struct numberEditor { ld *editwhat; @@ -1981,6 +1982,7 @@ namespace dialog { void use_hexeditor(); inline void scaleLog() { ne.sc = logarithmic; } inline void scaleSinh() { ne.sc = asinhic; } + inline void scaleSinh100() { ne.sc = asinhic100; } void bound_low(ld val); void bound_up(ld val);