Add Scroll::new
This commit is contained in:
parent
d0b4b4635e
commit
04d53ac5f4
1 changed files with 8 additions and 1 deletions
|
|
@ -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 }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue