diff --git a/src/cursor.rs b/src/cursor.rs index 84e80e3..fe44c8d 100644 --- a/src/cursor.rs +++ b/src/cursor.rs @@ -91,7 +91,7 @@ pub struct LayoutCursor { impl LayoutCursor { /// Create a new [`LayoutCursor`] - pub fn new(line: usize, layout: usize, glyph: usize) -> Self { + pub const fn new(line: usize, layout: usize, glyph: usize) -> Self { Self { line, layout, @@ -159,3 +159,10 @@ pub struct Scroll { /// if it is negative or exceeds the number of layout lines pub layout: i32, } + +impl Scroll { + /// Create a new cursor + pub const fn new(line: usize, layout: i32) -> Self { + Self { line, layout } + } +}