frang75 / nappgui_src

SDK for building cross-platform desktop apps in ANSI-C
https://www.nappgui.com
MIT License
506 stars 50 forks source link

Minor issue on MacOS Apple Silicon - slider mouse tracking incorrect #52

Closed chris-deep closed 10 months ago

chris-deep commented 1 year ago

First of all, I love this project. I ran some of the demo apps on MacOS and the slider control has a bug where the mouse tracking / slider thumb tracking are inverted... You click a slider thumb button, start dragging to the right, the nApp code places the slider value at the opposite value (e.g. say you click on position 0, the start of a slider - the code thinks you clicked at 100 and jumps the slider to 100... then when you slide to position 1, it jumps the tracker to position 99 and so on...). Prob just a simple (neg / pos value calculation bug or something like in the code) fix. When I have time and get the code built on Mac I'll look into it myself.

Unrelated note, I tried to build on Mac (M1 chip) with Xcode installed and Cmake installed and the CMake build spit out "Can't find compiler" type error. I'll open an issue about it some other day. But, once I get that sorted out so I can build run debug code. I'm sure I can pretty quickly find the issue with the slider tracking and offer some insight on it.

Thanks for this project!! It's like reading my entire career history of everything tool/framework I've either tried to use or tried to build myself bc I hated most of the cross platform tools and then I finally found this project... This is EXACTLY what I've been looking for, for years!! BRAVO for great work! Code is super clean... I don't know jack sht about CMake otherwise I could have figured out how to build it. But, I've read a lot of the code and I love it... (old school Win32 API / C developer and recently been learning and doing some Mac coding but with Swift which I hate...)

frang75 commented 1 year ago

Hi @chris-deep!

Thank you very much for your feedback and your words for the NAppGUI project. I hope the project suits your needs.

The problem you describe has already been corrected in this commit:

osgui/osx/osslider.m https://github.com/frang75/nappgui_src/commit/34b3f2551c4b884e65270b0f35f50240a26e0935

The pre-built demo apps have not been updated yet, but if you build from source, you'll see that it works fine now.

Thanks again, keep in touch.