Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

CSS Error parsing Warning may be thrown #503

Closed
leewyatt opened this issue Jan 27, 2022 · 0 comments · Fixed by #496
Closed

CSS Error parsing Warning may be thrown #503

leewyatt opened this issue Jan 27, 2022 · 0 comments · Fixed by #496
Labels
bug Something isn't working

Comments

@leewyatt
Copy link
Contributor

Control: Color Picker.
CSS warning may be thrown when the value of the alpha is a decimals stored in scientific notation;

Expected Behavior

Alpha values should be rounded.

Current Behavior

For example, alpha value is 7.552884496591084E-4
e.g. : The console will output:

CSS Error parsing '*{-fx-fill: hsb(224.0,100.0%,92.0%,7.552884496591084E-4)}: Unexpected token '7.552884496591084E' at [1,35]

Steps to Reproduce

Write an app, use colorpicker, drag the slider several times to adjust the value of alpha,
and usually throw this warning when the transparency is close to 0

Your Environment

Win10 x64; JDK17

Screenshots

Location:
https://github.com/gluonhq/scenebuilder/blob/master/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/util/control/paintpicker/colorpicker/ColorPicker.java
Line 462
Possible solution:
Source code: sb.append(alpha);
Modified code: sb.append(alpha_rounded); //alpha_rounded already exists

@leewyatt leewyatt added the bug Something isn't working label Jan 27, 2022
leewyatt added a commit to leewyatt/scenebuilder that referenced this issue Jan 30, 2022
Signed-off-by: leewyatt <leewyatt7788@gmail.com>
jperedadnr added a commit that referenced this issue Mar 12, 2024
* Add copy code function to Color Picker

Signed-off-by: leewyatt <leewyatt7788@gmail.com>

* Modify to not return null and Fix #503

Signed-off-by: leewyatt <leewyatt7788@gmail.com>

* Add licenses and tests

Signed-off-by: leewyatt <leewyatt7788@gmail.com>

* update licenses

Signed-off-by: leewyatt <leewyatt7788@gmail.com>

* Remove extra blank lines, remove null

Signed-off-by: leewyatt <leewyatt7788@gmail.com>

* Update to JUnit 5 API

* Prevent ColorPicker area from moving on mouse scroll and keyboard inputs: The area was previously shifting due to ScrollPane default behaviors.

* Remove extraneous whitespace line

* Refactored code placement and added comments as per review feedback.

* Update kit/src/main/java/com/oracle/javafx/scenebuilder/kit/util/control/paintpicker/colorpicker/ColorPicker.java

Co-authored-by: José Pereda <jperedadnr@gmail.com>

* updated copyright

---------

Signed-off-by: leewyatt <leewyatt7788@gmail.com>
Co-authored-by: Almas Baimagambetov <almaslvl@gmail.com>
Co-authored-by: José Pereda <jperedadnr@gmail.com>
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant