New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bugs/default canvas scale #3673
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the catch, a couple of questions inline
|
||
c := container.NewMax(image, bg) | ||
|
||
test.AssertImageMatches(t, "image_size.png", Render(c, theme.LightTheme())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of using this deprecated API why not use the test theme? Or default theme
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did just follow the pattern of the other tests in this file. I don't really mind switching to a different API, but should we do the same for the rest of the file to keep things consistent?
canvas/image.go
Outdated
@@ -285,6 +285,24 @@ func (i *Image) calculateMinSize() error { | |||
return nil | |||
} | |||
|
|||
func (img *Image) scaleSizeForCanvas(width, height int) (fyne.Size, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't this be a good candidate for the new scale
package?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, good idea!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't returning a coordinate, it is returning a size. Wouldn't "ToFyneSize" fit better with the naming you set up before?
Oh, that's a good name. Updated. |
Description:
This default image.MinSize() to be calculated with a SCALE=1 when using it with software.Render().
Fixes #2285
Checklist: