fix marker sizing
This commit is contained in:
parent
00bc66fd9a
commit
de9370ae92
1 changed files with 4 additions and 4 deletions
|
|
@ -140,10 +140,11 @@ var Marker = function(parentEl) {
|
||||||
* Draws a multi line marker, where lines span the full width
|
* Draws a multi line marker, where lines span the full width
|
||||||
*/
|
*/
|
||||||
this.drawMultiLineMarker = function(stringBuilder, range, clazz, layerConfig, type) {
|
this.drawMultiLineMarker = function(stringBuilder, range, clazz, layerConfig, type) {
|
||||||
// from selection start to the end of the line
|
|
||||||
var padding = type === "background" ? 0 : this.$padding;
|
var padding = type === "background" ? 0 : this.$padding;
|
||||||
|
var layerWidth = layerConfig.width + 2 * this.$padding - padding;
|
||||||
|
// from selection start to the end of the line
|
||||||
var height = layerConfig.lineHeight;
|
var height = layerConfig.lineHeight;
|
||||||
var width = Math.round(layerConfig.width - (range.start.column * layerConfig.characterWidth));
|
var width = Math.round(layerWidth - (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 = Math.round(
|
||||||
padding + range.start.column * layerConfig.characterWidth
|
padding + range.start.column * layerConfig.characterWidth
|
||||||
|
|
@ -174,12 +175,11 @@ var Marker = function(parentEl) {
|
||||||
if (height < 0)
|
if (height < 0)
|
||||||
return;
|
return;
|
||||||
top = this.$getTop(range.start.row + 1, layerConfig);
|
top = this.$getTop(range.start.row + 1, layerConfig);
|
||||||
width = layerConfig.width;
|
|
||||||
|
|
||||||
stringBuilder.push(
|
stringBuilder.push(
|
||||||
"<div class='", clazz, "' style='",
|
"<div class='", clazz, "' style='",
|
||||||
"height:", height, "px;",
|
"height:", height, "px;",
|
||||||
"width:", width, "px;",
|
"width:", layerWidth, "px;",
|
||||||
"top:", top, "px;",
|
"top:", top, "px;",
|
||||||
"left:", padding, "px;'></div>"
|
"left:", padding, "px;'></div>"
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue