fix: drag speed on pan
This commit is contained in:
+3
-4
@@ -11,9 +11,8 @@ import (
|
||||
/*
|
||||
Client pan integration for Fyne Draggable:
|
||||
|
||||
- DragEvent provides absolute coordinates in "Fyne units".
|
||||
- Client knows canvasScale (Fyne units per pixel) and converts to pixels.
|
||||
- We keep last drag position and compute dx/dy ourselves.
|
||||
- DragEvent.Dragged provides per-event delta in Fyne logical units.
|
||||
- Client knows canvasScale (pixels per Fyne unit) and converts to pixels.
|
||||
- We update camera center in world-fixed (CameraXWorldFp/YWorldFp).
|
||||
|
||||
Sign convention (map follows pointer):
|
||||
@@ -24,7 +23,7 @@ Sign convention (map follows pointer):
|
||||
// draggableClient is the minimal interface we need from your client implementation.
|
||||
// If your Client already has these methods/fields, you can fold the code directly into it.
|
||||
type draggableClient interface {
|
||||
// CanvasScale returns the fyne-units-per-pixel scale factor.
|
||||
// CanvasScale returns pixels per Fyne logical unit.
|
||||
CanvasScale() float32
|
||||
|
||||
// UpdateParams applies a mutation and schedules refresh through your coalescer.
|
||||
|
||||
Reference in New Issue
Block a user