examples/dragmascot: add a comment

Updates #2783
This commit is contained in:
Hajime Hoshi 2024-03-22 12:41:05 +09:00
parent f2f037ebda
commit 86f53b73e3

View File

@ -90,6 +90,7 @@ func (m *mascot) Update() error {
m.dragStartCursorX, m.dragStartCursorY = ebiten.CursorPosition()
}
if m.dragging {
// Move the window only by the delta of the cursor.
cx, cy := ebiten.CursorPosition()
dx := int(float64(cx-m.dragStartCursorX) * m.cursorToWindowX)
dy := int(float64(cy-m.dragStartCursorY) * m.cursorToWindowY)