| Summary: | [editor][chrome]Mouse and cursor don't line up | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [ECD] Orion | Reporter: | John Arthorne <john.arthorne> | ||||||||
| Component: | Client | Assignee: | Silenio Quarti <Silenio_Quarti> | ||||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||||
| Severity: | normal | ||||||||||
| Priority: | P3 | CC: | aniefer, eclipse.felipe, malgorzata.tomczyk, mamacdon, Silenio_Quarti | ||||||||
| Version: | 0.2 | ||||||||||
| Target Milestone: | 0.2 | ||||||||||
| Hardware: | PC | ||||||||||
| OS: | Windows 7 | ||||||||||
| Whiteboard: | |||||||||||
| Bug Depends on: | 334910 | ||||||||||
| Bug Blocks: | |||||||||||
| Attachments: |
|
||||||||||
|
Description
John Arthorne
Created attachment 193375 [details]
Screen shot
You can also see the problem looking at the line numbers. This file does have 212 lines, but in the screen shot you can see there are two more lines after the "212" number in the margin. The line numbers aren't matching the lines.
Created attachment 193790 [details]
Screenshot
I see the same problem on:
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.16) Gecko/20110319 (CK-IBM) Firefox/3.6.16 ( .NET CLR 3.5.30729)
I opened gitCommand.js. Scrolled to the middle of the file. Then I was trying to select with the mouse the line marked with the red arrow on the screenshot. The line below was selected instead.
There a couple for factors causing this problem.
First and more important is that line height is a float number at these zoom levels. We can workaround that by replacing:
_getLineHeight: function() {
var document = this._frameDocument;
var body = document.body;
return parseInt(body.style.lineHeight, 10);
},
By:
_getLineHeight: function() {
var document = this._frameDocument;
var body = document.body;
var lineHeight = parseFloat(body.style.lineHeight);
return Math.round(lineHeight);
},
Not sure this is enterily correct, maybe Math.ceil is better here.
The real height is the height for the line div.
The other problem is that, on Chrome, at 120% zoom lines with bold are taller than lines without bold. This can only be fixed with Bug 334910.
Created attachment 194110 [details]
Screenshot editing HTML file
Another symptom seems to be that the cursor is totally broken when editing HTML files at 120% zoom on chrome. See in this screen shot the cursor is on line 1, but the status line shows the cursor is on line 4. If I start typing the characters appear on line 4. Basically the arrow keys don't seem to move the cursor. At 100% zoom it is fine, and it is fine in FireFox 4.
We fixed a couple problems on the code with CSS pixel versus screen pixel, but the problem with bold fonts will only be fixed when we fix bug 334910. If you remove bold from the CSS file you should be able to use the editor with zoom. We add support for bold,italic,bold|italic styling without implementing variable line height. Please try the latest. Fixed http://git.eclipse.org/c/e4/org.eclipse.orion.client.git/commit/?id=72cb95a23a0216ca2d89974ea81d212f30da002f *** Bug 344751 has been marked as a duplicate of this bug. *** *** Bug 336178 has been marked as a duplicate of this bug. *** |