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

canvas element width during zooms #186

Closed
wants to merge 1 commit into from
Closed

Conversation

skinner
Copy link
Member

@skinner skinner commented Jan 9, 2013

In the demos I've looked at, canvas elements in tracks don't scale with everything else during zoom transitions, leaving gaps (on zoom-in transitions) or overlaps (on zoom-outs).

Canvas elements have an internal notion of width and height, which are the pixel dimensions of the drawing area. And, as HTML elements, they also have CSS width and height properties, which do not have to correspond to the pixel dimensions of the drawing area. In other words, canvas.width and canvas.style.width are semantically different and can be set independently.

This patch sets the CSS width of canvas elements to 100% so that they stretch and shrink with everything else during zooms. I've barely tested it (only on Firefox) but it seems to do what I wanted.

@rbuels
Copy link
Collaborator

rbuels commented Jan 24, 2013

Tested on Chrome, Firefox, and IE10, works on all of them.

Merged. Thanks Mitch! Hope you're doing well!

@rbuels rbuels closed this Jan 24, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature req this adds new functionality to JBrowse 1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants