GithubHelp home page GithubHelp logo

Resize issue about super-animation-samples HOT 9 CLOSED

raymondlu avatar raymondlu commented on September 28, 2024
Resize issue

from super-animation-samples.

Comments (9)

raymondlu avatar raymondlu commented on September 28, 2024

thank you.

I will try to reproduce this bug on my Mac later.
In my code, I use AppKit built-in function to convert string to a float value.
not very sure whether it relates to locale setting.

I don't know whether I am very clear about your issue.
If you input non-integer value, for example 0.75 or 1.50, which is the standard way to represent a float value,
the converter doesn't work properly?

from super-animation-samples.

FrancoisDupayrat avatar FrancoisDupayrat commented on September 28, 2024

If I input 0.75, I get the popup about between 0.1 and 10.0. If I input 1.50, it automatically reset to 1.00 when I press enter.

I didn't find the source code of the Converter on the repo, is it available somewhere ? I could try to fix the bug myself if it's open source.

from super-animation-samples.

raymondlu avatar raymondlu commented on September 28, 2024

Here it is a workaround, maybe you can have a try.
Go to System Preferences/Language & Text on your Mac, in the popup dialog, select the Formats tab,
then you can change the Region, maybe you can change to Unites States, or China, then run the converter again.

from super-animation-samples.

FrancoisDupayrat avatar FrancoisDupayrat commented on September 28, 2024

Thanks, it's working. On Mac OS 10.8.2, the options is under Preferences -> Language & Text -> Region Tab -> Customize Numbers. There I can change the separator from ',' to '.'

from super-animation-samples.

mrdedalinez avatar mrdedalinez commented on September 28, 2024

why you wold not parse the string to replace ',' to '.' defore convert to a float from string?

from super-animation-samples.

raymondlu avatar raymondlu commented on September 28, 2024

thank you for your suggestion.
in my code, I am using AppKit built-in function to convert string to a float value, which is not under my control.
unfortunately that that function doesn't work properly if your OS language is French.
still don't know why.
yes, I could get the raw string from editor box, and convert it manually by myself to fix this bug.
:-)

from super-animation-samples.

FrancoisDupayrat avatar FrancoisDupayrat commented on September 28, 2024

From the behavior, I'd say you use the function 2 times : the first time to validate the input when the user press enter : this time works fine and convert the ',' to '.'
But then, you redo that validation using the converted string when the user click the resize button, which trigger a problem since the '.' isn't good anymore.

A possible solution would be to keep the float value the first time to validate it and use that instead of retrying to validate the string in the box.

from super-animation-samples.

raymondlu avatar raymondlu commented on September 28, 2024

Thank you for your suggestion.
I think I know where goes wrong after reviewing my code.
And I've just uploaded a new binary, could you help me to do a little test for this issue?

from super-animation-samples.

FrancoisDupayrat avatar FrancoisDupayrat commented on September 28, 2024

It's working perfectly, thanks. I'm closing the issue.

from super-animation-samples.

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.