fix: drag speed on pan

This commit is contained in:
Ilia Denisov
2026-03-17 15:39:30 +02:00
committed by GitHub
parent 3db0c9afda
commit dee4b4da56
3 changed files with 110 additions and 5 deletions
+3 -4
View File
@@ -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.