Skip to content

Commit

Permalink
Use scale.ToFyneSize instead.
Browse files Browse the repository at this point in the history
  • Loading branch information
Cedric BAIL committed Feb 24, 2023
1 parent 585ce48 commit cef3524
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion canvas/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ func (img *Image) minSizeFromReader(source io.Reader) (fyne.Size, error) {
img.aspect = float32(width) / float32(height)
}

dpSize, err := scale.AdaptToFyneCoordinate(img, width, height)
dpSize, err := scale.ToFyneSize(img, width, height)
if err != nil {
dpSize = fyne.NewSize(float32(width), float32(height))
}
Expand Down
2 changes: 1 addition & 1 deletion internal/scale/scale.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func ToFyneCoordinate(c fyne.Canvas, v int) float32 {
}
}

func AdaptToFyneCoordinate(obj fyne.CanvasObject, width, height int) (fyne.Size, error) {
func ToFyneSize(obj fyne.CanvasObject, width, height int) (fyne.Size, error) {
app := fyne.CurrentApp()
if app == nil {
return fyne.NewSize(0, 0), errors.New("no current app")
Expand Down

0 comments on commit cef3524

Please sign in to comment.