do not break subpixel positioning of markers
This commit is contained in:
parent
f38a4e0e5b
commit
f4507df564
2 changed files with 6 additions and 11 deletions
|
|
@ -127,8 +127,7 @@ var Cursor = function(parentEl) {
|
||||||
if (!position)
|
if (!position)
|
||||||
position = this.session.selection.getCursor();
|
position = this.session.selection.getCursor();
|
||||||
var pos = this.session.documentToScreenPosition(position);
|
var pos = this.session.documentToScreenPosition(position);
|
||||||
var cursorLeft = Math.round(this.$padding +
|
var cursorLeft = this.$padding + pos.column * this.config.characterWidth;
|
||||||
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;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -78,9 +78,7 @@ var Marker = function(parentEl) {
|
||||||
range = range.toScreenRange(this.session);
|
range = range.toScreenRange(this.session);
|
||||||
if (marker.renderer) {
|
if (marker.renderer) {
|
||||||
var top = this.$getTop(range.start.row, config);
|
var top = this.$getTop(range.start.row, config);
|
||||||
var left = Math.round(
|
var left = this.$padding + range.start.column * config.characterWidth;
|
||||||
this.$padding + range.start.column * config.characterWidth
|
|
||||||
);
|
|
||||||
marker.renderer(html, range, left, top, config);
|
marker.renderer(html, range, left, top, config);
|
||||||
}
|
}
|
||||||
else if (range.isMultiLine()) {
|
else if (range.isMultiLine()) {
|
||||||
|
|
@ -137,7 +135,7 @@ var Marker = function(parentEl) {
|
||||||
// from selection start to the end of the line
|
// from selection start to the end of the line
|
||||||
var height = config.lineHeight;
|
var height = config.lineHeight;
|
||||||
var top = this.$getTop(range.start.row, config);
|
var top = this.$getTop(range.start.row, config);
|
||||||
var left = Math.round(padding + range.start.column * config.characterWidth);
|
var left = padding + range.start.column * config.characterWidth;
|
||||||
|
|
||||||
stringBuilder.push(
|
stringBuilder.push(
|
||||||
"<div class='", clazz, " ace_start' style='",
|
"<div class='", clazz, " ace_start' style='",
|
||||||
|
|
@ -149,7 +147,7 @@ var Marker = function(parentEl) {
|
||||||
|
|
||||||
// from start of the last line to the selection end
|
// from start of the last line to the selection end
|
||||||
top = this.$getTop(range.end.row, config);
|
top = this.$getTop(range.end.row, config);
|
||||||
var width = Math.round(range.end.column * config.characterWidth);
|
var width = range.end.column * config.characterWidth;
|
||||||
|
|
||||||
stringBuilder.push(
|
stringBuilder.push(
|
||||||
"<div class='", clazz, "' style='",
|
"<div class='", clazz, "' style='",
|
||||||
|
|
@ -182,12 +180,10 @@ var Marker = function(parentEl) {
|
||||||
if (type === "background")
|
if (type === "background")
|
||||||
var width = layerConfig.width;
|
var width = layerConfig.width;
|
||||||
else
|
else
|
||||||
width = Math.round((range.end.column + (extraLength || 0) - range.start.column) * layerConfig.characterWidth);
|
width = (range.end.column + (extraLength || 0) - range.start.column) * layerConfig.characterWidth;
|
||||||
|
|
||||||
var top = this.$getTop(range.start.row, layerConfig);
|
var top = this.$getTop(range.start.row, layerConfig);
|
||||||
var left = Math.round(
|
var left = padding + range.start.column * layerConfig.characterWidth;
|
||||||
padding + range.start.column * layerConfig.characterWidth
|
|
||||||
);
|
|
||||||
|
|
||||||
stringBuilder.push(
|
stringBuilder.push(
|
||||||
"<div class='", clazz, "' style='",
|
"<div class='", clazz, "' style='",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue