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 {
/// 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 }
}
}