Skip to content

Commit b70d22c

Browse files
authored
[Fix] highlight block incorrect width (#85)
1 parent 57297cb commit b70d22c

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

core/src/components/highlight_code_block.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
use crate::{config::HighlightLine, edges::padding::Padding, utils::color::RgbaColor};
1+
use crate::{
2+
config::HighlightLine,
3+
edges::{edge::Edge, padding::Padding},
4+
utils::color::RgbaColor,
5+
};
26

37
use super::{
48
editor::code::CODE_LINE_HEIGHT,
@@ -105,7 +109,7 @@ impl HighlightCodeBlock {
105109
let rect = Rect::from_xywh(
106110
render_params.x - self.editor_padding.left,
107111
render_params.y + start_y_offset,
108-
parent_style.width,
112+
parent_style.width + self.editor_padding.horizontal(),
109113
// If end_line_number is equal to start_line_number, the height should be line_height
110114
(end_line_number - start_line_number + 1) as f32 * CODE_LINE_HEIGHT,
111115
)

0 commit comments

Comments
 (0)