Fix render misalignment. Looks good so far.
This commit is contained in:
parent
353c6a4f4a
commit
1d9dbe6d3e
2 changed files with 10 additions and 2 deletions
|
|
@ -157,7 +157,7 @@ exports.launch = function(env) {
|
|||
docs.svg.addFold(new Range(1, 0, 7, 0), "fold...");
|
||||
|
||||
docs.plain.addFold(new Range(0, 90, 2, 30), "fold");
|
||||
window.s = docs.js;
|
||||
window.s = docs.plain;
|
||||
window.e = env.editor;
|
||||
setTimeout(function() {
|
||||
env.editor.selection.addEventListener("changeCursor", function() {
|
||||
|
|
|
|||
|
|
@ -478,6 +478,14 @@ var VirtualRenderer = function(container, theme) {
|
|||
var firstRowScreen, firstRowHeight;
|
||||
var lineHeight = { lineHeight: this.lineHeight };
|
||||
firstRow = session.screenToDocumentRow(firstRow, 0);
|
||||
|
||||
// Check if firstRow is inside of a foldLine. If true, then use the first
|
||||
// row of the foldLine.
|
||||
var foldLine = session.getFoldLine(firstRow);
|
||||
if (foldLine) {
|
||||
firstRow = foldLine.start.row;
|
||||
}
|
||||
|
||||
firstRowScreen = session.documentToScreenRow(firstRow, 0);
|
||||
firstRowHeight = session.getRowHeight(lineHeight, firstRow);
|
||||
|
||||
|
|
@ -501,7 +509,7 @@ var VirtualRenderer = function(container, theme) {
|
|||
};
|
||||
|
||||
// For debugging.
|
||||
console.log(JSON.stringify(layerConfig));
|
||||
// console.log(JSON.stringify(layerConfig));
|
||||
|
||||
this.$gutterLayer.element.style.marginTop = (-offset) + "px";
|
||||
this.content.style.marginTop = (-offset) + "px";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue