mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-29 23:48:11 +08:00
Improve scrollbar behavior (#351)
* Change scrollbar behavior * Leave space at the end of the scrollbar * Change mid to center * Use shorter array initialization * Add space around scrollbar * Fix scrollbar spacing * Smooth end of scrollbars * Add page up and down * Page up and down on click in scrollbar track * Add shift pageup to translate horizontally
This commit is contained in:
@@ -22,6 +22,10 @@ impl ViewportBounds {
|
||||
pub fn size(&self) -> DVec2 {
|
||||
self.bottom_right - self.top_left
|
||||
}
|
||||
|
||||
pub fn center(&self) -> DVec2 {
|
||||
self.bottom_right.lerp(self.top_left, 0.5)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Copy, Clone, Default, Eq, PartialEq, Hash)]
|
||||
|
||||
Reference in New Issue
Block a user