Checkpoint

This commit is contained in:
Nathan Sobo 2023-10-23 15:14:10 +02:00
parent d1adce5890
commit fc927f7406
3 changed files with 5 additions and 5 deletions

View file

@ -8,7 +8,7 @@ use std::{
}; };
#[derive( #[derive(
Refineable, Default, Add, AddAssign, Sub, SubAssign, Copy, Debug, PartialEq, Eq, Hash, Neg, Refineable, Default, Add, AddAssign, Sub, SubAssign, Copy, Debug, PartialEq, Eq, Hash,
)] )]
#[refineable(debug)] #[refineable(debug)]
#[repr(C)] #[repr(C)]

View file

@ -548,12 +548,12 @@ pub trait ElementInteraction<V: 'static + Send + Sync>: 'static + Send + Sync {
if overflow.x == Overflow::Scroll { if overflow.x == Overflow::Scroll {
scroll_offset.x = scroll_offset.x =
(scroll_offset.x - delta.x).clamp(px(0.), scroll_max.width); (scroll_offset.x + delta.x).clamp(-scroll_max.width, px(0.));
} }
if overflow.y == Overflow::Scroll { if overflow.y == Overflow::Scroll {
scroll_offset.y = scroll_offset.y =
(scroll_offset.y - delta.y).clamp(px(0.), scroll_max.height); (scroll_offset.y + delta.y).clamp(-scroll_max.height, px(0.));
} }
if *scroll_offset != old_scroll_offset { if *scroll_offset != old_scroll_offset {

View file

@ -469,7 +469,7 @@ impl<'a, 'w> WindowContext<'a, 'w> {
.layout_engine .layout_engine
.layout_bounds(layout_id) .layout_bounds(layout_id)
.map(Into::into); .map(Into::into);
bounds.origin -= self.element_offset(); bounds.origin += self.element_offset();
bounds bounds
} }
@ -812,7 +812,7 @@ impl<'a, 'w> WindowContext<'a, 'w> {
if let Some(mut active_drag) = cx.active_drag.take() { if let Some(mut active_drag) = cx.active_drag.take() {
cx.stack(1, |cx| { cx.stack(1, |cx| {
let mouse_position = -cx.mouse_position(); let mouse_position = cx.mouse_position();
cx.with_element_offset(Some(mouse_position), |cx| { cx.with_element_offset(Some(mouse_position), |cx| {
let available_space = let available_space =
size(AvailableSpace::MinContent, AvailableSpace::MinContent); size(AvailableSpace::MinContent, AvailableSpace::MinContent);