You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! I hope that this message finds someone who can explain to me how horizontal scroll work :)
Here's my code:
use cosmic_text::{FontSystem, Metrics, Buffer, Wrap, Attrs, Family, Shaping, Scroll};
fn main() {
let mut font_system = FontSystem::new();
let metrics = Metrics::new(14.0, 20.0);
let mut buffer = Buffer::new(&mut font_system, metrics);
let mut buffer = buffer.borrow_with(&mut font_system);
buffer.set_wrap(Wrap::None);
buffer.set_size(Some(100.0), Some(50.0));
buffer.set_text(
"Lorem ipsum dolor sit amet, qui minim labore adipisicing minim sint cillum sint consectetur cupidatat.",
Attrs::new().family(Family::SansSerif),
Shaping::Advanced
);
let scroll = Scroll::new(0, 15.0, 200.0);
buffer.set_scroll(scroll);
// Perform shaping as desired
buffer.shape_until_scroll(false);
for run in buffer.layout_runs() {
println!("Layout run: {:?}", run);
}
}
However, it doesn't seem like setting horizontal scroll changes anything anywhere. Changing vertical scroll works fine. Is there something I'm missing here? Rendering the buffer to the screen also applies vertical scroll correctly, but does nothing with horizontal one.
The text was updated successfully, but these errors were encountered:
Hi! I hope that this message finds someone who can explain to me how horizontal scroll work :)
Here's my code:
However, it doesn't seem like setting horizontal scroll changes anything anywhere. Changing vertical scroll works fine. Is there something I'm missing here? Rendering the buffer to the screen also applies vertical scroll correctly, but does nothing with horizontal one.
The text was updated successfully, but these errors were encountered: