Add Scroll::new

This commit is contained in:
Jeremy Soller 2023-12-15 13:58:24 -07:00
parent d0b4b4635e
commit 04d53ac5f4

View file

@ -91,7 +91,7 @@ pub struct LayoutCursor {
impl LayoutCursor { impl LayoutCursor {
/// Create a new [`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 { Self {
line, line,
layout, layout,
@ -159,3 +159,10 @@ pub struct Scroll {
/// if it is negative or exceeds the number of layout lines /// if it is negative or exceeds the number of layout lines
pub layout: i32, pub layout: i32,
} }
impl Scroll {
/// Create a new cursor
pub const fn new(line: usize, layout: i32) -> Self {
Self { line, layout }
}
}