Skip to content

Commit

Permalink
Merge pull request #3554 from andydotxyz/fix/iframes
Browse files Browse the repository at this point in the history
  • Loading branch information
andydotxyz committed Jan 10, 2023
2 parents 4e94498 + 9bf914a commit fe77710
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion internal/driver/glfw/window_goxjs.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ func (w *window) setCustomCursor(rawCursor *Cursor, isCustomCursor bool) {
}

func (w *window) mouseMoved(_ *glfw.Window, xpos, ypos float64) {
w.processMouseMoved(xpos, ypos)
w.processMouseMoved(w.scaleInput(xpos), w.scaleInput(ypos))
}

func (w *window) mouseClicked(viewport *glfw.Window, btn glfw.MouseButton, action glfw.Action, mods glfw.ModifierKey) {
Expand Down
11 changes: 11 additions & 0 deletions internal/driver/glfw/window_js.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
//go:build js && !wasm && !test_web_driver
// +build js,!wasm,!test_web_driver

package glfw

import "math"

func (w *window) scaleInput(in float64) float64 {
return math.Ceil(in * float64(w.canvas.Scale()))

}
8 changes: 8 additions & 0 deletions internal/driver/glfw/window_wasm.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
//go:build wasm || test_web_driver
// +build wasm test_web_driver

package glfw

func (w *window) scaleInput(in float64) float64 {
return in
}

0 comments on commit fe77710

Please sign in to comment.