mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-13 20:42:07 +01:00
ebiten: English
This commit is contained in:
parent
654c4c286c
commit
922784f574
4
image.go
4
image.go
@ -513,7 +513,7 @@ func (i *Image) DrawTrianglesShader(vertices []Vertex, indices []uint16, shader
|
|||||||
b := img.Bounds()
|
b := img.Bounds()
|
||||||
x, y := img.adjustPosition(b.Min.X, b.Min.Y)
|
x, y := img.adjustPosition(b.Min.X, b.Min.Y)
|
||||||
// (sx, sy) is the left-upper position of the first image.
|
// (sx, sy) is the left-upper position of the first image.
|
||||||
// Calculate the direction between the current image's left-upper position and the first one's.
|
// Calculate the distance between the current image's left-upper position and the first one's.
|
||||||
offsets[i][0] = float32(x - sx)
|
offsets[i][0] = float32(x - sx)
|
||||||
offsets[i][1] = float32(y - sy)
|
offsets[i][1] = float32(y - sy)
|
||||||
}
|
}
|
||||||
@ -612,7 +612,7 @@ func (i *Image) DrawRectShader(width, height int, shader *Shader, options *DrawR
|
|||||||
b := img.Bounds()
|
b := img.Bounds()
|
||||||
x, y := img.adjustPosition(b.Min.X, b.Min.Y)
|
x, y := img.adjustPosition(b.Min.X, b.Min.Y)
|
||||||
// (sx, sy) is the left-upper position of the first image.
|
// (sx, sy) is the left-upper position of the first image.
|
||||||
// Calculate the direction between the current image's left-upper position and the first one's.
|
// Calculate the distance between the current image's left-upper position and the first one's.
|
||||||
offsets[i][0] = float32(x - sx)
|
offsets[i][0] = float32(x - sx)
|
||||||
offsets[i][1] = float32(y - sy)
|
offsets[i][1] = float32(y - sy)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user