clip the cursor before rendering
This commit is contained in:
parent
537209da57
commit
caad347a39
2 changed files with 2 additions and 6 deletions
|
|
@ -45,8 +45,6 @@ var TextMode = require("ace/mode/text").Mode;
|
||||||
var Range = require("ace/range").Range;
|
var Range = require("ace/range").Range;
|
||||||
var Document = require("ace/document").Document;
|
var Document = require("ace/document").Document;
|
||||||
|
|
||||||
var NO_CHANGE_DELTAS = {};
|
|
||||||
|
|
||||||
var EditSession = function(text, mode) {
|
var EditSession = function(text, mode) {
|
||||||
this.$modified = true;
|
this.$modified = true;
|
||||||
this.$breakpoints = [];
|
this.$breakpoints = [];
|
||||||
|
|
@ -54,7 +52,6 @@ var EditSession = function(text, mode) {
|
||||||
this.$backMarkers = {};
|
this.$backMarkers = {};
|
||||||
this.$markerId = 1;
|
this.$markerId = 1;
|
||||||
this.$wrapData = [];
|
this.$wrapData = [];
|
||||||
this.listeners = [];
|
|
||||||
|
|
||||||
if (text instanceof Document) {
|
if (text instanceof Document) {
|
||||||
this.setDocument(text);
|
this.setDocument(text);
|
||||||
|
|
|
||||||
|
|
@ -58,8 +58,7 @@ var Cursor = function(parentEl) {
|
||||||
};
|
};
|
||||||
|
|
||||||
this.setCursor = function(position, overwrite) {
|
this.setCursor = function(position, overwrite) {
|
||||||
this.position =
|
this.position = position;
|
||||||
this.session.documentToScreenPosition(position);
|
|
||||||
|
|
||||||
if (overwrite) {
|
if (overwrite) {
|
||||||
dom.addCssClass(this.cursor, "ace_overwrite");
|
dom.addCssClass(this.cursor, "ace_overwrite");
|
||||||
|
|
@ -108,7 +107,7 @@ var Cursor = function(parentEl) {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
var pos = this.position;
|
var pos = this.session.documentToScreenPosition(this.position);
|
||||||
var cursorLeft = Math.round(pos.column * this.config.characterWidth);
|
var cursorLeft = Math.round(pos.column * this.config.characterWidth);
|
||||||
var cursorTop = (pos.row - (onScreen ? this.config.firstRowScreen : 0)) *
|
var cursorTop = (pos.row - (onScreen ? this.config.firstRowScreen : 0)) *
|
||||||
this.config.lineHeight;
|
this.config.lineHeight;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue