https://linen.dev logo
Join Discord
Powered by
# haxe-ui
  • b

    bright-gpu-74537

    12/11/2022, 10:48 PM
    sure, but for me to really understand super minimal repros are helpful... there is not "ready" anything here: http://haxeui.org/builder/?d32b80ef, so if i have to invent it, its possible (probable?) ill get the repro wrong and it will all be fine.
  • h

    hallowed-ocean-84954

    12/11/2022, 10:49 PM
    sorry - incomplete message on that front
  • h

    hallowed-ocean-84954

    12/11/2022, 10:49 PM
    ok So the min and max labels are set to the slider min and max divided by the scale and rendered with a post-decimal point precision number of places
  • h

    hallowed-ocean-84954

    12/11/2022, 10:50 PM
    this is working for the min but not the max
  • h

    hallowed-ocean-84954

    12/11/2022, 10:50 PM
    but a few minutes ago it was right for both
  • h

    hallowed-ocean-84954

    12/11/2022, 10:50 PM
    but of course I've changed code 🙂
  • b

    bright-gpu-74537

    12/11/2022, 10:51 PM
    sure, but yeah, trying to work backwards from words is almost impossible for me, if you could code me up a minimal repro then a) ill instantly understand and b) we have a test case to apply to DoD
  • h

    hallowed-ocean-84954

    12/11/2022, 10:53 PM
    I don't know about minimal but it's
  • h

    hallowed-ocean-84954

    12/11/2022, 10:53 PM
    if you have to go - go - I'll figure it out eventually
  • b

    bright-gpu-74537

    12/11/2022, 10:53 PM
    looks pretty minimal to me
  • h

    hallowed-ocean-84954

    12/11/2022, 10:53 PM
    but the code in question is how lsMax.text is being set in the cbk
  • b

    bright-gpu-74537

    12/11/2022, 10:55 PM
    you mean that its saying "7000" rather than "70.0"?
  • b

    bright-gpu-74537

    12/11/2022, 10:57 PM
    i presume it must be a logic bug in "formatFloat", because if i change it to "lsMax.text = Std.string(lsSlider.max);" it just shows "70"
  • h

    hallowed-ocean-84954

    12/11/2022, 10:57 PM
    ah .... I missed a case
  • h

    hallowed-ocean-84954

    12/11/2022, 10:57 PM
    it is in there
  • h

    hallowed-ocean-84954

    12/11/2022, 10:58 PM
    the problem is that because 70.0 is 4 chars, and my precision is 4 the code breaks
  • b

    bright-gpu-74537

    12/11/2022, 10:59 PM
    alright, im really going to bed now ( 🙂 )... haxeui issue or user code issue?
  • b

    bright-gpu-74537

    12/11/2022, 11:00 PM
    im thinking the latter as without formatFloat it all seems fine
  • h

    hallowed-ocean-84954

    12/11/2022, 11:00 PM
    oh no - not haxeui - mine
  • h

    hallowed-ocean-84954

    12/11/2022, 11:00 PM
    sorry - to waste your time
  • b

    bright-gpu-74537

    12/11/2022, 11:00 PM
    cool... ill sleep better having not added some weird "on ready" bug to my list 🙂
  • b

    bright-gpu-74537

    12/11/2022, 11:00 PM
    no hassle, no bother... sleep well! 🙂
  • h

    hallowed-ocean-84954

    12/11/2022, 11:01 PM
    thanx
  • h

    hallowed-ocean-84954

    12/12/2022, 2:11 AM
    So I have this going with a custom component. http://haxeui.org/builder/?afea4275 This solves 2 problems. It scales the slider so that it can provide a slider for values less than one, and it provides a single component with labelling and string formatting that supports a range < 1.0. But then I went back and looked at https://github.com/haxeui/haxeui-core/blob/master/haxe/ui/components/Slider.hx. It seems it has a notion of precision and step that should have been able to do the slider for values of less than one thing. But it appears it cannot. I added a similarly set up slider and labels to the test case and indeed it doesn't slide neatly - just goes to either end. So am I right in assuming that sliders really need to be over ranges numerically greater than 1.0 or have I missed something ?
  • f

    full-journalist-82607

    12/12/2022, 8:11 AM
    I think it's a bug 🙂 . It should work.
  • f

    full-journalist-82607

    12/12/2022, 8:16 AM
    It has to do with haxe.ui.util.MathUtil.roundToNearest(0.094, 0.01) is 0
  • f

    full-journalist-82607

    12/12/2022, 8:20 AM
    Copy code
    haxe
     public static inline function roundToNearest(v:Float, n:Float):Float {
            var r = v % n;
            if (r <= n / 2) {
                return Math.fround(v - r);
            }
            return Math.fround(v + n - r);
        }
    It used Math.fround which rounds to the nearest integer
  • b

    bright-gpu-74537

    12/12/2022, 8:21 AM
    yeah, defo looks like a bug in slider / mathutil
  • h

    hallowed-ocean-84954

    12/12/2022, 2:32 PM
    ah ok - makes sense - I saw the start and end behaviours but I don't understand how they work and I thought they only covered hitting the end stops rather than other spots on the slider - but then I couldn't see where the rest of the slider was covered - so yeah time to plead for help 🙂
  • r

    refined-cat-44047

    12/15/2022, 1:45 AM
    I know this is probably not a priority, but I am testing a few things with the AIR target using
    lime test air -debug
    , and am getting a compilation error from haxeui-core.
    Copy code
    C:/HaxeToolkit/haxe/lib/haxeui-core/git/haxe/ui/util/ImageLoader.hx:132: characters 41-56 : haxe.Http has no field responseHeaders
    C:/HaxeToolkit/haxe/lib/haxeui-core/git/haxe/ui/util/ImageLoader.hx:134: characters 41-56 : haxe.Http has no field responseHeaders
    I don't have a small sample app, but I assume it is probably easy to repeat, although getting the AIR SDK can be a pain.
1...133313341335...1687Latest