Merge branch 'master' into advanced-text

This commit is contained in:
Héctor Ramón Jiménez 2023-05-02 06:40:48 +02:00
commit 8e8808f0e1
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
12 changed files with 173 additions and 70 deletions

View file

@ -102,9 +102,8 @@ pub fn main() -> Result<(), Box<dyn std::error::Error>> {
capabilities
.formats
.iter()
.filter(|format| format.describe().srgb)
.copied()
.next()
.find(wgpu::TextureFormat::is_srgb)
.or_else(|| capabilities.formats.first().copied())
.expect("Get preferred format"),
adapter

View file

@ -36,7 +36,7 @@ enum Message {
ScrollerWidthChanged(u16),
ScrollToBeginning,
ScrollToEnd,
Scrolled(scrollable::RelativeOffset),
Scrolled(scrollable::Viewport),
}
impl Application for ScrollableDemo {
@ -104,8 +104,8 @@ impl Application for ScrollableDemo {
self.current_scroll_offset,
)
}
Message::Scrolled(offset) => {
self.current_scroll_offset = offset;
Message::Scrolled(viewport) => {
self.current_scroll_offset = viewport.relative_offset();
Command::none()
}