mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
parent
f2f037ebda
commit
86f53b73e3
@ -90,6 +90,7 @@ func (m *mascot) Update() error {
|
|||||||
m.dragStartCursorX, m.dragStartCursorY = ebiten.CursorPosition()
|
m.dragStartCursorX, m.dragStartCursorY = ebiten.CursorPosition()
|
||||||
}
|
}
|
||||||
if m.dragging {
|
if m.dragging {
|
||||||
|
// Move the window only by the delta of the cursor.
|
||||||
cx, cy := ebiten.CursorPosition()
|
cx, cy := ebiten.CursorPosition()
|
||||||
dx := int(float64(cx-m.dragStartCursorX) * m.cursorToWindowX)
|
dx := int(float64(cx-m.dragStartCursorX) * m.cursorToWindowX)
|
||||||
dy := int(float64(cy-m.dragStartCursorY) * m.cursorToWindowY)
|
dy := int(float64(cy-m.dragStartCursorY) * m.cursorToWindowY)
|
||||||
|
Loading…
Reference in New Issue
Block a user