Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

HSlider correctRounding #327

Closed
pixelzoom opened this issue Oct 25, 2017 · 2 comments
Closed

HSlider correctRounding #327

pixelzoom opened this issue Oct 25, 2017 · 2 comments
Assignees

Comments

@pixelzoom
Copy link
Contributor

Function correctRounding is defined inside the HSlider constructor, so every instance has a copy of this function. If you add one more parameter (the value of valueProperty.value), then this function could be moved outside the constructor (private to the file, not in the inherit call), and 1 copy of the function will be shared by all instances.

Recommended signature:

function correctRounding( newValue, currentValue, stepSize )

Example usage on line 375:

newValue = correctRounding( newValue, valueProperty.get(), stepSize )

@pixelzoom
Copy link
Contributor Author

Btw... Private functions are typically located after the sun.register call and before the inherit call.

@jessegreenberg
Copy link
Contributor

Thanks @pixelzoom, I changed the signature to what you recommended in the ticket. I also moved the function out of constructor so it is shared, and moved it after sun.register call. But for #326 it is no longer in HSlider and in a trait called AccessibleSlider. AccessibleSlider is going to be reviewed in that issue. Closing this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants