Fixing bug in selection rendering which was misplaced since padding was not used.
This commit is contained in:
parent
f90084bfba
commit
2ed9c5d599
1 changed files with 12 additions and 9 deletions
|
|
@ -55,7 +55,6 @@ var Marker = function(parentEl) {
|
|||
this.setPadding = function(padding) {
|
||||
this.$padding = padding;
|
||||
};
|
||||
|
||||
this.setSession = function(session) {
|
||||
this.session = session;
|
||||
};
|
||||
|
|
@ -131,7 +130,8 @@ var Marker = function(parentEl) {
|
|||
var height = layerConfig.lineHeight;
|
||||
var width = Math.round(layerConfig.width - (range.start.column * layerConfig.characterWidth));
|
||||
var top = this.$getTop(range.start.row, layerConfig);
|
||||
var left = Math.round(range.start.column * layerConfig.characterWidth);
|
||||
var left = Math.round(this.$padding +
|
||||
range.start.column * layerConfig.characterWidth);
|
||||
|
||||
stringBuilder.push(
|
||||
"<div class='", clazz, "' style='",
|
||||
|
|
@ -142,27 +142,30 @@ var Marker = function(parentEl) {
|
|||
);
|
||||
|
||||
// from start of the last line to the selection end
|
||||
var top = this.$getTop(range.end.row, layerConfig);
|
||||
var width = Math.round(range.end.column * layerConfig.characterWidth);
|
||||
top = this.$getTop(range.end.row, layerConfig);
|
||||
width = Math.round(range.end.column * layerConfig.characterWidth);
|
||||
|
||||
stringBuilder.push(
|
||||
"<div class='", clazz, "' style='",
|
||||
"height:", height, "px;",
|
||||
"width:", width, "px;",
|
||||
"top:", top, "px;",
|
||||
"width:", width, "px;'></div>"
|
||||
"left:", left, "px;'></div>"
|
||||
);
|
||||
|
||||
// all the complete lines
|
||||
var height = (range.end.row - range.start.row - 1) * layerConfig.lineHeight;
|
||||
height = (range.end.row - range.start.row - 1) * layerConfig.lineHeight;
|
||||
if (height < 0)
|
||||
return;
|
||||
var top = this.$getTop(range.start.row + 1, layerConfig);
|
||||
top = this.$getTop(range.start.row + 1, layerConfig);
|
||||
width = layerConfig.width;
|
||||
|
||||
stringBuilder.push(
|
||||
"<div class='", clazz, "' style='",
|
||||
"height:", height, "px;",
|
||||
"width:", layerConfig.width, "px;",
|
||||
"top:", top, "px;'></div>"
|
||||
"width:", width, "px;",
|
||||
"top:", top, "px;",
|
||||
"left:", left, "px;'></div>"
|
||||
);
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue