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

visibleRegion() in GenomeView.js sometimes returning end with float values #491

Closed
rdhayes opened this Issue Jun 27, 2014 · 2 comments

Comments

Projects
None yet
2 participants
@rdhayes
Copy link
Contributor

rdhayes commented Jun 27, 2014

I sometimes get a floating point value for the end attribute of genomeView.visibleRegion(). I believe a fractional pxToBp() result for the scrollbar width in the maxVisible() method on line 1207 of GenomeView.js leads to this situation. Return values set up in lines 1210 - 1213 only apply Math.round() to the mv variable, but I think this should be rounding the entire return value after subtracting the scrollbar width.

Is anyone aware of any usage of visibleRegion() or MaxVisible where anything other than an integer representing the rightmost bp is expected?

In contrast, GenomeView.visibleRegionLocString(), via Util.assembleLocString(), always rounds the start and end attributes that are returned.

I could always just apply Math.round() in the function callback where I am using the visibleRegion() object, and maybe that's better procedure, but this feels like a bug.

@rdhayes rdhayes added the bug label Jun 27, 2014

@rbuels

This comment has been minimized.

Copy link
Collaborator

rbuels commented Jul 11, 2018

@rdhayes is this still a problem? I want to schedule this for work if so

@rbuels rbuels added the small task label Jul 11, 2018

@rdhayes

This comment has been minimized.

Copy link
Contributor Author

rdhayes commented Jul 11, 2018

I haven't seen this in a while. GenomeView.js maxVisible() has var scrollbar set to the results of a pxToBp() call, which can be fractional and looks to be the source of the behavior that prompted this.

Enclosing the right side of line 1253 with Math.round() looks like it'll solve things.

@rbuels rbuels added this to the 1.15.1 milestone Jul 11, 2018

@rbuels rbuels closed this in 156d6d5 Jul 19, 2018

@rbuels rbuels modified the milestones: 1.15.1, 1.15.0 Jul 19, 2018

rbuels added a commit that referenced this issue Jul 19, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.