Skip to content

Commit

Permalink
OK... now rotation on emoji is wrong again...
Browse files Browse the repository at this point in the history
I may need to do a blame and see when things changed last.
  • Loading branch information
tommyettinger committed Jan 9, 2025
1 parent e3744bc commit 9876730
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions src/main/java/com/github/tommyettinger/textra/Font.java
Original file line number Diff line number Diff line change
Expand Up @@ -5192,7 +5192,7 @@ public float drawGlyph(Batch batch, long glyph, float x, float y, float rotation
float trrh = tr.getRegionHeight();
float yt = (font.originalCellHeight - (trrh + tr.offsetY)) * scaleY * sizingY + sin * centerX
- centerY;
if(squashed) yt -= font.descent * scaleY * 0.175f;
if(squashed) yt -= font.descent * scaleY * sizingY * 0.175f;

float h = trrh * scaleY * sizingY;

Expand Down Expand Up @@ -5229,12 +5229,19 @@ public float drawGlyph(Batch batch, long glyph, float x, float y, float rotation
// x += xch + changedW + stretchShift;

float ych = tr.offsetY * scaleY * sizingY;
yt = sin * centerX - centerY - ych + font.descent * font.scaleY * scale * 0.5f;
if(squashed) yt -= font.descent * scaleY * 0.175f;
// yt = (font.originalCellHeight - (trrh + tr.offsetY)) * scaleY * sizingY + sin * centerX
// - centerY;

// yt = sin * centerX - centerY - ych + font.descent * font.scaleY * scale * 0.5f;


yt = - ych - stretchShift - font.descent * fsy * scale * sizingY + sin * centerX - centerY;
if(squashed) yt -= font.descent * scaleY * sizingY * 0.175f;
// yt -= ych + stretchShift;
// y += ych + stretchShift;

y += ych - stretchShift + font.descent * fsy * scale * sizingY;

//yt += scaledHeight * 0.5f;//ych - font.descent * fsy * scale * sizingY;
y += ych - stretchShift;// - stretchShift * scale * sizingY;
// y += (font.descent * font.scaleY - stretchShift) * scale * sizingY + ych;
}
// when this is removed, rotations for icons go around the bottom center.
// but, with it here, the rotations go around the bottom left corner.
Expand Down

0 comments on commit 9876730

Please sign in to comment.