Checklist
Describe the bug
I have an image that was created with SubImage(aka a tile from a tileset for application in pixel-art style) and, because of that, Bounds().Min is actually not equal to zero
According to the Go blog: The Go image package, it's a normal situation: "A common mistake is assuming that an Image’s bounds start at (0, 0)"
But when I'm trying to render that image, after transforming it to the Raster via NewRasterFromImage, on the canvas it actually renders starting from this Bounds().Min
Expected behaviour was that the image inside the Raster renders from zero, because after that we can position it however we want on the screen, like any other CanvasObject
How to reproduce
- Run the code snippet
Screenshots
Example code
func main() {
application := app.NewWithID("Test image position")
window := application.NewWindow("Test image position")
img := image.NewRGBA(image.Rect(150, 200, 300, 400))
bounds := img.Bounds()
uniform := image.Uniform{C: color.RGBA{R: 0, G: 0, B: 0, A: 255}}
draw.Draw(img, bounds, &uniform, bounds.Min, draw.Src)
rasterImage := canvas.NewRasterFromImage(img)
window.SetContent(rasterImage)
window.ShowAndRun()
}
Fyne version
2.8.0
Go compiler version
1.25.0
Operating system and version
Arch Linux x86_64
Additional Information
No response
Checklist
Describe the bug
I have an image that was created with SubImage(aka a tile from a tileset for application in pixel-art style) and, because of that,
Bounds().Minis actually not equal to zeroAccording to the Go blog: The Go image package, it's a normal situation: "A common mistake is assuming that an Image’s bounds start at (0, 0)"
But when I'm trying to render that image, after transforming it to the Raster via NewRasterFromImage, on the canvas it actually renders starting from this
Bounds().MinExpected behaviour was that the image inside the Raster renders from zero, because after that we can position it however we want on the screen, like any other CanvasObject
How to reproduce
Screenshots
Example code
Fyne version
2.8.0
Go compiler version
1.25.0
Operating system and version
Arch Linux x86_64
Additional Information
No response