| Summary: | Lines in the ruler do not align with the lines of code | ||
|---|---|---|---|
| Product: | [ECD] Orion | Reporter: | Mihai Sucan <mihai.sucan> |
| Component: | Editor | Assignee: | Mihai Sucan <mihai.sucan> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | eclipse.felipe, mihai.sucan, Silenio_Quarti |
| Version: | unspecified | ||
| Target Milestone: | 0.4 M1 | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
|
Description
Mihai Sucan
Proposed fix: https://github.com/mihaisucan/orion.client/tree/bug-362286 Investigation yielded the following results: - with Monaco 12pt, real line height was 21px. - calculateLineHeight gave 20px which caused the misalignment of the lines in the ruler and the lines of code. - that result also broke hit testing - one could click on the last visible line, but Orion would select two lines above, and other weird behavior. Anything using line height went wrong, of course. - checked the situation and it seems that the spans generated by calculateLineHeight are indeed only 20px, it's only the line div that is taller. - checked if this was only weirdness during calculateLineHeight. it's not. - when the editor runs and the real line rendering happens I inspected the SPANs with Firebug. their computed height is indeed 20px. Again, only the line DIV has 21px. Solution: since we can't rely on the spans height, I just grab the line DIV height in calculateLineHeight. That works now and it doesn't cause regressions with the other fonts. Tested on Linux with Firefox, Opera and Chrome. Please let me know if any further changes are needed. This bug is now high priority for Mozilla (P1). Thank you! I am 99% sure Silenio and I had this code in the past. The problem was that the height in the linediv was a bit too big (one pixel) in some cases. Leaving a visible white gab between selected lines. I suspect you can confirm this case by disabling full selection (see construction options) and selecting text in the editor (several lines). Try different fonts maybe. Either way, I'm okay if you push your change to master as this bug is more serious than the original one (specially now that full selection hides the original bug anyway). (In reply to comment #2) > I am 99% sure Silenio and I had this code in the past. > The problem was that the height in the linediv was a bit too big (one pixel) in > some cases. Leaving a visible white gab between selected lines. I suspect you > can confirm this case by disabling full selection (see construction options) > and selecting text in the editor (several lines). Try different fonts maybe. That can probably be fixed by setting line.style.lineHeight = computedHeight. > Either way, I'm okay if you push your change to master as this bug is more > serious than the original one (specially now that full selection hides the > original bug anyway). Thank you! I will push the fix. |