Skip to content

Commit

Permalink
[ArcBallController] Use captured pointer events
Browse files Browse the repository at this point in the history
  • Loading branch information
hyazinthh committed Feb 4, 2025
1 parent bc58750 commit 535a877
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
1 change: 1 addition & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
- Fixed multisampled raw download
- [ArcBallController] Use captured pointer events

### 5.5.2
- updated Adaptify.Core to 1.3.0 (using local, new style adaptify)
Expand Down
10 changes: 4 additions & 6 deletions src/Aardvark.UI.Primitives/Controllers/ArcBallController.fs
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ module ArcBallController =

{ model with view = cam; dragStart = pos; orbitCenter = center }


[<Obsolete>]
let onMouseDown (cb : MouseButtons -> V2i -> 'msg) =
onEvent
"onmousedown"
Expand Down Expand Up @@ -288,14 +288,12 @@ module ArcBallController =
let attributes (state : AdaptiveCameraControllerState) (f : Message -> 'msg) =
AttributeMap.ofListCond [
always (onBlur (fun _ -> f Blur))
always (onMouseDown (fun b p -> f (Down(b,p))))
//always (onCapturedPointerDown (Some 2) (fun t b p -> match t with Mouse -> f (Down(b,p)) | _ -> f (Down(b,p))))
//always (onCapturedPointerUp (Some 2) (fun t b p -> match t with Mouse -> f (Up(b)) | _ -> f (Down(b,p))))
always (onMouseUp (fun b p -> f (Up b)))
always (onCapturedPointerDown None (fun t b p -> match t with Mouse -> f (Down(b,p)) | _ -> f Nop))
always (onCapturedPointerUp None (fun t b p -> match t with Mouse -> f (Up(b)) | _ -> f Nop))
always (onKeyDown (KeyDown >> f))
always (onKeyUp (KeyUp >> f))
always (onWheelPrevent true (fun x -> f (Wheel x)))
onlyWhen (state.look %|| state.pan %|| state.zoom) (onMouseMove (Move >> f))
onlyWhen (state.look %|| state.pan %|| state.zoom) (onCapturedPointerMove None (fun t p -> match t with Mouse -> f (Move p) | _ -> f Nop ))
]

let extractAttributes (state : AdaptiveCameraControllerState) (f : Message -> 'msg) =
Expand Down

0 comments on commit 535a877

Please sign in to comment.