Skip to content

Commit

Permalink
fixed build for vs2022
Browse files Browse the repository at this point in the history
  • Loading branch information
haraldsteinlechner committed Nov 2, 2021
1 parent b51c8a6 commit b28775d
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions src/Application/Aardvark.Application.Slim/Window.fs
Original file line number Diff line number Diff line change
Expand Up @@ -199,24 +199,25 @@ module private GameWindowIO =

let mousePos() =
try
match ctrl with
| Some ctrl ->
let state = OpenTK.Input.Mouse.GetCursorState()
let p = ctrl.PointToClient(Drawing.Point(state.X, state.Y))
let s = ctrl.ClientSize
match ctrl with
| Some ctrl ->
let state = OpenTK.Input.Mouse.GetCursorState()
let p = ctrl.PointToClient(Drawing.Point(state.X, state.Y))
let s = ctrl.ClientSize

let x = clamp 0 (s.Width-1) p.X
let y = clamp 0 (s.Height-1) p.Y
let x = clamp 0 (s.Width-1) p.X
let y = clamp 0 (s.Height-1) p.Y

PixelPosition(x, y, ctrl.ClientSize.Width, ctrl.ClientSize.Height)
| _ ->
PixelPosition(0,0,0,0)
with e ->
PixelPosition(x, y, ctrl.ClientSize.Width, ctrl.ClientSize.Height)
| _ ->
PixelPosition(0,0,0,0)
with e ->
Log.warn "could not grab mouse position."
lastPos


let onMouseDownHandler = EventHandler<MouseButtonEventArgs>(fun s e -> this.Down(%%e, %e.Button))

let onMouseDownHandler = EventHandler<MouseButtonEventArgs>(fun s e -> this.Down((%%e), (%e.Button)))
let onMouseUpHandler = EventHandler<MouseButtonEventArgs>(fun s e -> this.Up(%%e, %e.Button))
let onMouseMoveHandler = EventHandler<MouseMoveEventArgs>(fun s e -> this.Move %%e)
let onMouseWheelHandler = EventHandler<MouseWheelEventArgs>(fun s e -> this.Scroll (%%e, (float e.Delta * 120.0)))
Expand Down

0 comments on commit b28775d

Please sign in to comment.