mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
shareable: Bug fix: The first image's region in the uniform vriables was ignored
This commit is contained in:
parent
1fe2f47701
commit
999b726b72
@ -321,8 +321,12 @@ func (i *Image) DrawTriangles(img *Image, vertices []float32, indices []uint16,
|
||||
if img != nil {
|
||||
i.processSrc(img)
|
||||
}
|
||||
firstImg := img
|
||||
for _, u := range uniforms {
|
||||
if src, ok := u.(*Image); ok {
|
||||
if firstImg == nil {
|
||||
firstImg = src
|
||||
}
|
||||
i.processSrc(src)
|
||||
}
|
||||
}
|
||||
@ -333,9 +337,10 @@ func (i *Image) DrawTriangles(img *Image, vertices []float32, indices []uint16,
|
||||
dx = paddingSize
|
||||
dy = paddingSize
|
||||
}
|
||||
|
||||
var oxf, oyf float32
|
||||
if img != nil {
|
||||
ox, oy, _, _ := img.regionWithPadding()
|
||||
if firstImg != nil {
|
||||
ox, oy, _, _ := firstImg.regionWithPadding()
|
||||
ox += paddingSize
|
||||
oy += paddingSize
|
||||
oxf, oyf = float32(ox), float32(oy)
|
||||
|
Loading…
Reference in New Issue
Block a user