package scale
import "fyne.io/fyne/v2/internal/scale"
Index ¶
- func ToFyneCoordinate(c fyne.Canvas, v int) float32
- func ToFyneSize(obj fyne.CanvasObject, width, height int) fyne.Size
- func ToScreenCoordinate(c fyne.Canvas, v float32) int
Functions ¶
func ToFyneCoordinate ¶
ToFyneCoordinate converts a screen coordinate for a given canvas to a fyne coordinate
func ToFyneSize ¶
func ToFyneSize(obj fyne.CanvasObject, width, height int) fyne.Size
ToFyneSize returns the scaled size of an object based on pixel coordinates, typically for images. This method will attempt to find the canvas for an object to get its scale. In the event that this fails it will assume a 1:1 mapping (scale=1 or low DPI display).
func ToScreenCoordinate ¶
ToScreenCoordinate converts a fyne coordinate in the given canvas to a screen coordinate
Source Files ¶
scale.go
- Version
- v2.5.4 (latest)
- Published
- Feb 1, 2025
- Platform
- linux/amd64
- Imports
- 2 packages
- Last checked
- 1 month ago –
Tools for package owners.