Skip to content

Commit

Permalink
Fix top of head texture being rotated
Browse files Browse the repository at this point in the history
  • Loading branch information
PassTheMayo committed Oct 5, 2023
1 parent 0fa80a8 commit 585d815
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions body.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func RenderBody(skin *image.NRGBA, opts Options) *image.NRGBA {

var (
frontHead *image.NRGBA = removeTransparency(extract(skin, HeadFront))
topHead *image.NRGBA = removeTransparency(extract(skin, HeadTop))
topHead *image.NRGBA = rotate90(removeTransparency(extract(skin, HeadTop)))

This comment has been minimized.

Copy link
@t-mart

t-mart Oct 5, 2023

Do we only need a single rotate90 (and/or not a rotate180)? I'm still seeing the errant behavior on the site:

image

This comment has been minimized.

Copy link
@PassTheMayo

PassTheMayo Oct 6, 2023

Author Member

That is weird, because I solved this issue using the sample skins that you provided in #2, but I can also cause this to happen with the skin of that player even after implementing this fix. Here's the result of the fix I implemented in this commit:

image

This comment has been minimized.

Copy link
@PassTheMayo

PassTheMayo Oct 6, 2023

Author Member

Ignore my last comment, I was able to get this figured out. I had to rotate90 and also flipHorizontally. This is fixed in v1.1.1.

rightHead *image.NRGBA = removeTransparency(extract(skin, HeadRight))
frontTorso *image.NRGBA = removeTransparency(extract(skin, TorsoFront))
frontLeftArm *image.NRGBA = nil
Expand All @@ -41,7 +41,7 @@ func RenderBody(skin *image.NRGBA, opts Options) *image.NRGBA {
if opts.Overlay {
overlaySkin := fixTransparency(skin)

topHead = composite(topHead, extract(overlaySkin, HeadOverlayTop), 0, 0)
topHead = composite(topHead, rotate90(extract(overlaySkin, HeadOverlayTop)), 0, 0)
frontHead = composite(frontHead, extract(overlaySkin, HeadOverlayFront), 0, 0)
rightHead = composite(rightHead, extract(overlaySkin, HeadOverlayRight), 0, 0)

Expand Down
4 changes: 2 additions & 2 deletions head.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ func RenderHead(skin *image.NRGBA, opts Options) *image.NRGBA {

var (
frontHead *image.NRGBA = removeTransparency(extract(skin, HeadFront))
topHead *image.NRGBA = removeTransparency(extract(skin, HeadTop))
topHead *image.NRGBA = rotate90(removeTransparency(extract(skin, HeadTop)))
rightHead *image.NRGBA = removeTransparency(extract(skin, HeadRight))
)

if opts.Overlay {
overlaySkin := fixTransparency(skin)

frontHead = composite(frontHead, extract(overlaySkin, HeadOverlayFront), 0, 0)
topHead = composite(topHead, extract(overlaySkin, HeadOverlayTop), 0, 0)
topHead = composite(topHead, rotate90(extract(overlaySkin, HeadOverlayTop)), 0, 0)
rightHead = composite(rightHead, extract(overlaySkin, HeadOverlayRight), 0, 0)
}

Expand Down

0 comments on commit 585d815

Please sign in to comment.