mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
go fmt
This commit is contained in:
parent
970b087035
commit
faa9c1bfe8
@ -44,8 +44,8 @@ func (game *RotatingImage) Draw(g graphics.GraphicsContext, offscreen graphics.T
|
||||
geometryMatrix.Translate(-tx/2, -ty/2)
|
||||
geometryMatrix.Rotate(float64(game.x) / 60)
|
||||
geometryMatrix.Translate(tx/2, ty/2)
|
||||
centerX, centerY := float64(offscreen.Width) / 2, float64(offscreen.Height) / 2
|
||||
geometryMatrix.Translate(centerX - tx/2, centerY - ty/2)
|
||||
centerX, centerY := float64(offscreen.Width)/2, float64(offscreen.Height)/2
|
||||
geometryMatrix.Translate(centerX-tx/2, centerY-ty/2)
|
||||
g.DrawTexture(game.ebitenTexture.ID,
|
||||
0, 0, int(tx), int(ty),
|
||||
geometryMatrix,
|
||||
|
@ -1,3 +1 @@
|
||||
package matrix_test
|
||||
|
||||
|
||||
|
@ -52,7 +52,7 @@ func (matrix *Geometry) Rotate(theta float64) {
|
||||
rotate := Geometry{
|
||||
[2][3]float64{
|
||||
{cos, -sin, 0},
|
||||
{sin, cos, 0},
|
||||
{sin, cos, 0},
|
||||
},
|
||||
}
|
||||
matrix.Concat(rotate)
|
||||
|
@ -51,8 +51,8 @@ func (device *Device) Update() {
|
||||
scale := float64(g.screenScale)
|
||||
geometryMatrix := matrix.Geometry{
|
||||
[2][3]float64{
|
||||
{scale, 0, 0},
|
||||
{0, scale, 0},
|
||||
{scale, 0, 0},
|
||||
{0, scale, 0},
|
||||
},
|
||||
}
|
||||
g.DrawTexture(device.offscreenTexture.ID,
|
||||
|
Loading…
Reference in New Issue
Block a user