Position drag handle relative to cursor

This commit is contained in:
Nathan Sobo 2023-10-23 15:20:33 +02:00
parent fc927f7406
commit 258fcaea94
3 changed files with 24 additions and 20 deletions

View file

@ -11,9 +11,9 @@ use smallvec::SmallVec;
use crate::{
current_platform, image_cache::ImageCache, Action, AnyBox, AnyView, AppMetadata, AssetSource,
Context, DispatchPhase, DisplayId, Executor, FocusEvent, FocusHandle, FocusId, KeyBinding,
Keymap, LayoutId, MainThread, MainThreadOnly, Platform, SharedString, SubscriberSet,
Subscription, SvgRenderer, Task, TextStyle, TextStyleRefinement, TextSystem, View, Window,
WindowContext, WindowHandle, WindowId,
Keymap, LayoutId, MainThread, MainThreadOnly, Pixels, Platform, Point, SharedString,
SubscriberSet, Subscription, SvgRenderer, Task, TextStyle, TextStyleRefinement, TextSystem,
View, Window, WindowContext, WindowHandle, WindowId,
};
use anyhow::{anyhow, Result};
use collections::{HashMap, HashSet, VecDeque};
@ -736,6 +736,7 @@ pub(crate) enum Effect {
pub(crate) struct AnyDrag {
pub drag_handle_view: AnyView,
pub cursor_offset: Point<Pixels>,
pub state: AnyBox,
pub state_type: TypeId,
}