From c7549aa5d53fb62f134b31a44d09029ceee3c800 Mon Sep 17 00:00:00 2001 From: Alice Koreman Date: Fri, 30 Aug 2024 16:59:10 +0200 Subject: [PATCH] fix: apply padding to right side multi-line markers (#5636) --- src/layer/marker.js | 4 ++-- src/marker_group_test.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/layer/marker.js b/src/layer/marker.js index 935e1b8a4c..3307c7b89b 100644 --- a/src/layer/marker.js +++ b/src/layer/marker.js @@ -165,7 +165,7 @@ class Marker { } else { this.elt( clazz + " ace_br1 ace_start", - "height:"+ height+ "px;"+ "right:0;"+ "top:"+top+ "px;left:"+ left+ "px;" + (extraStyle || "") + "height:"+ height+ "px;"+ "right:" + padding + "px;"+ "top:"+top+ "px;left:"+ left+ "px;" + (extraStyle || "") ); } // from start of the last line to the selection end @@ -197,7 +197,7 @@ class Marker { this.elt( clazz + (radiusClass ? " ace_br" + radiusClass : ""), "height:"+ height+ "px;"+ - "right:0;"+ + "right:" + padding + "px;"+ "top:"+ top+ "px;"+ "left:"+ padding+ "px;"+ (extraStyle || "") ); diff --git a/src/marker_group_test.js b/src/marker_group_test.js index 6e65fd3d50..f8006daab8 100644 --- a/src/marker_group_test.js +++ b/src/marker_group_test.js @@ -114,8 +114,8 @@ module.exports = { assert.equal(markerSize.height, lineHeight); // Should start at the 13th character (including 4px offset) assert.equal(markerSize.left, 12 * characterWidth + 4); - // Shoud be as wide as the marker layer - 12 characters and the offset. - assert.equal(markerSize.width, editor.renderer.$markerBack.element.getBoundingClientRect().width - 12 * characterWidth - 4); + // Shoud be as wide as the marker layer - 12 characters and the offset on both sides. + assert.equal(markerSize.width, editor.renderer.$markerBack.element.getBoundingClientRect().width - 12 * characterWidth - 4 - 4); }, "test: should default to markers of text type": function() { editor.resize(true);