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

Fix selection redraw during window resize. #333

Closed
wants to merge 1 commit into from
Closed

Fix selection redraw during window resize. #333

wants to merge 1 commit into from

Conversation

gruehle
Copy link
Contributor

@gruehle gruehle commented Jan 21, 2012

This fixes the cosmetic problem with selection highlighting that occurs when resizing the window.

This problem is most visible in WebKit browsers.

Use width: instead of right: for selection highlight div positioning.
@marijnh
Copy link
Member

marijnh commented Jan 25, 2012

This cause another problem. If you put the cursor in the middle of a line, and then select text with shift-left, you'll see the right of the selection wobble (by a single pixel) as a result of rounding errors. I think that is a more visible problem than the one solved by this patch, so I'm not merging it as it stands.

Does the problem you were fixing occur in the demos? Or only in a different layout? In the second case, please provide some HTML that demonstrates it, since I still don't see it (in Chrome) in the demo pages.

@marijnh marijnh closed this Jan 25, 2012
@gruehle
Copy link
Contributor Author

gruehle commented Jan 26, 2012

Here is a screencast that shows the issue I'm seeing. This is the Theme demo from the CodeMirror website:
http://youtu.be/UQAeGs9k73A

Other people at my office have also reproduced the problem.

Which demo file shows the single pixel wobble? I'm not seeing it on my Mac (Chrome, Firefox, Safari).

@marijnh
Copy link
Member

marijnh commented Jan 27, 2012

Other people at my office have also reproduced the problem.

I see. I can reproduce it now, I just wasn't resizing the window
quickly enough. This is probably caused by a DOM redraw happening
before CodeMirror's resize has a chance to adjust the selection
geometry. It does always seem to go back to a consistent state when
the resizing is finished.

I don't consider this a critical issue. It'd be good to fix it, but
I'm not lying awake at night in the meantime.

Which demo file shows the single pixel wobble? I'm not seeing it on my Mac (Chrome, Firefox, Safari).

I get it in all demos on Chrome Linux. It's probably font and
drawing-engine related.

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

Successfully merging this pull request may close these issues.

2 participants