Skip to content
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

Image not showing since fyne update #3102

Closed
amo13 opened this issue Jun 27, 2022 · 4 comments
Closed

Image not showing since fyne update #3102

amo13 opened this issue Jun 27, 2022 · 4 comments
Labels
blocker Items that would block a forthcoming release bug Something isn't working

Comments

@amo13
Copy link

amo13 commented Jun 27, 2022

Describe the bug:

Since I updated fyne from 2.1.4 to 2.2.1 the image in my application is not showing any more.
Here is a small example where I'd expect to see the image in the application but it doesn't appear:

package main

import (
	"fyne.io/fyne/v2"
	"fyne.io/fyne/v2/app"
	"fyne.io/fyne/v2/canvas"
	"fyne.io/fyne/v2/layout"
	"fyne.io/fyne/v2/container"
)

func main() {
	a := app.NewWithID("my.app")
	w := a.NewWindow("MyApp")
	w.SetMaster()

	w.Resize(fyne.NewSize(562, 226))
	w.SetContent(initScreen())

	w.ShowAndRun()
}

func initScreen() fyne.CanvasObject {
	logo := canvas.NewImageFromFile("logo.png")
	logo.FillMode = canvas.ImageFillOriginal

	leftside := container.NewVBox(layout.NewSpacer(), logo, layout.NewSpacer())
	rightside := container.NewVBox(layout.NewSpacer())

	grid := container.New(layout.NewGridLayout(2), leftside, rightside)
	return container.NewVBox(layout.NewSpacer(), grid, layout.NewSpacer())
}

I use this logo.png file. The issue is the same if I bundle it.

  • OS: At least linux and windows
  • Go version: 1.18.3
  • Fyne version: 2.2.1

Any help would be greatly appreciated. I am probably only missing something trivial, but I can't see it...

@amo13 amo13 added the unverified A bug that has been reported but not verified label Jun 27, 2022
@andydotxyz
Copy link
Member

Just out of interest I think container.NewVBox(layout.NewSpacer(), logo, layout.NewSpacer()) is the same as container.NewCenter(logo)

@andydotxyz
Copy link
Member

It seems to be that ImageFillOriginal is not rendering in v2.2.1 for some reason!

@andydotxyz andydotxyz added bug Something isn't working blocker Items that would block a forthcoming release and removed unverified A bug that has been reported but not verified labels Jun 27, 2022
andydotxyz added a commit to andydotxyz/fyne that referenced this issue Jun 27, 2022
@andydotxyz
Copy link
Member

This is in the proposed v2.2.2 release due in 2 days. Apologies for the inconvenience.

@amo13
Copy link
Author

amo13 commented Jun 28, 2022

Thanks a lot for addressing this so fast!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocker Items that would block a forthcoming release bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants