Skip to content
This repository was archived by the owner on Apr 29, 2021. It is now read-only.

Commit b3d8a17

Browse files
author
Yuncong Zhang
committed
Fix emoji size.
1 parent eb7037d commit b3d8a17

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Runtime/ui/txt/emoji.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ public static Image image {
235235
public const int colCount = 37;
236236

237237
public static Rect getMinMaxRect(float fontSize, float ascent, float descent) {
238-
return Rect.fromLTWH(fontSize * 0.05f, descent - fontSize, fontSize * 0.9f, fontSize * 0.9f);
238+
return Rect.fromLTWH(0, descent/2-fontSize, fontSize, fontSize);
239239
}
240240

241241
public static Rect getUVRect(int code) {

Runtime/ui/txt/layout.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -226,9 +226,9 @@ static float _layoutEmoji(string text, int start, int count, TextStyle style, Fo
226226

227227

228228
var minX = x;
229-
var maxX = metrics.descent - metrics.ascent + x;
230-
var minY = metrics.ascent;
231-
var maxY = metrics.descent;
229+
var maxX = style.fontSize + x;
230+
var minY = metrics.descent/2 - style.fontSize;
231+
var maxY = metrics.descent/2;
232232
_updateBounds(minX, maxX, minY, maxY, ref bounds);
233233

234234
positions[i] = x;

0 commit comments

Comments
 (0)