Skip to content

Commit

Permalink
shareable: Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
hajimehoshi committed Sep 20, 2020
1 parent 138d9b8 commit 8d17ec8
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions internal/shareable/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -354,16 +354,14 @@ func (i *Image) DrawTriangles(srcs [graphics.ShaderImageNum]*Image, vertices []f
}

var offsets [graphics.ShaderImageNum - 1][2]float32
for i := range offsets {
for i, subimageOffset := range subimageOffsets {
src := srcs[i+1]
if src == nil {
continue
}
ox, oy, _, _ := src.regionWithPadding()
ox += paddingSize
oy += paddingSize
offsets[i][0] = float32(ox) - oxf + subimageOffsets[i][0]
offsets[i][1] = float32(oy) - oyf + subimageOffsets[i][1]
offsets[i][0] = float32(ox) + paddingSize - oxf + subimageOffset[0]
offsets[i][1] = float32(oy) + paddingSize - oyf + subimageOffset[1]
}

var s *restorable.Shader
Expand Down

0 comments on commit 8d17ec8

Please sign in to comment.