GithubHelp home page GithubHelp logo

Comments (5)

jeremyherbert avatar jeremyherbert commented on July 22, 2024

Found the problem: all of the min and max arguments are swapped when passing through Cython. This is the same for all drag_float and drag_int types (and maybe more? I only checked these ones). I'll try to create a pull request when I get the time, I don't have a build environment set up to test the changes so it might take a bit.

core.pyx: (around line 3084)

cdef float[2] inout_values = [value0, value1]
    return cimgui.DragFloat2(
        _bytes(label), <float*>&inout_values,
        change_speed, max_value, min_value, _bytes(display_format), power
    ), (inout_values[0], inout_values[1])

cimgui.pxd: (around line 595)

bool DragFloat(  # ✓
            const char* label, float* v,
            # note: optional
            float v_speed, float v_min, float v_max,
            const char* display_format, float power
    ) except +

from pyimgui.

swistakm avatar swistakm commented on July 22, 2024

@jeremyherbert this is a very good catch. Thanks for PR too :)

from pyimgui.

swistakm avatar swistakm commented on July 22, 2024

Fix released as #54. I have additionally reversed the order of min/max arguments (non-keyword) in drag widgets to be more consistent with C++ API.

from pyimgui.

jeremyherbert avatar jeremyherbert commented on July 22, 2024

Cool, thanks for the quick work. I was thinking about changing the order of arguments, but I didn’t want to break backwards compatibility.

Although in hindsight, if this is the first time the bug has showed up, I might be the only one using this feature ;)

from pyimgui.

swistakm avatar swistakm commented on July 22, 2024

Released as 0.1.0

from pyimgui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.