FINALLY FIXED STUPID TEST UI ISSUES (true painter.rs moment) + scrolling
This commit is contained in:
@@ -10,7 +10,7 @@ pub trait CoreWidget<W, Tag> {
|
||||
fn width(self, len: impl Into<Len>) -> impl WidgetFn<Sized>;
|
||||
fn height(self, len: impl Into<Len>) -> impl WidgetFn<Sized>;
|
||||
fn offset(self, amt: impl Into<UiVec2>) -> impl WidgetFn<Offset>;
|
||||
fn scroll(self) -> impl WidgetIdFn<Offset>;
|
||||
fn scroll(self) -> impl WidgetIdFn<Scroll>;
|
||||
fn masked(self) -> impl WidgetFn<Masked>;
|
||||
fn background<T>(self, w: impl WidgetLike<T>) -> impl WidgetFn<Stack>;
|
||||
fn z_offset(self, offset: usize) -> impl WidgetFn<Stack>;
|
||||
@@ -77,11 +77,14 @@ impl<W: WidgetLike<Tag>, Tag> CoreWidget<W::Widget, Tag> for W {
|
||||
}
|
||||
}
|
||||
|
||||
fn scroll(self) -> impl WidgetIdFn<Offset> {
|
||||
self.offset(UiVec2::ZERO)
|
||||
.edit_on(CursorSense::Scroll, |w, data| {
|
||||
w.amt += UiVec2::abs(data.scroll_delta * 50.0);
|
||||
})
|
||||
fn scroll(self) -> impl WidgetIdFn<Scroll> {
|
||||
move |ui| {
|
||||
Scroll::new(self.add(ui).any(), Axis::Y)
|
||||
.edit_on(CursorSense::Scroll, |w, data| {
|
||||
w.scroll(data.scroll_delta.y * 50.0);
|
||||
})
|
||||
.add(ui)
|
||||
}
|
||||
}
|
||||
|
||||
fn masked(self) -> impl WidgetFn<Masked> {
|
||||
|
||||
Reference in New Issue
Block a user