mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-04 00:45:35 +00:00
text: [API] reduce size of Glyph.Runes to uint16
This shrinks text.Glyph from 72B to 58B. LabelStatic/1000runes-RTL-arabic-32 63.62µ ± 0% 62.05µ ± 0% -2.47% (p=0.002 n=6) Signed-off-by: Egon Elbre <egonelbre@gmail.com>
This commit is contained in:
+1
-1
@@ -138,7 +138,7 @@ func (it *textIterator) processGlyph(g text.Glyph, ok bool) (_ text.Glyph, visib
|
||||
if it.maxLines > 0 {
|
||||
if g.Flags&text.FlagTruncator != 0 && g.Flags&text.FlagClusterBreak != 0 {
|
||||
// A glyph carrying both of these flags provides the count of truncated runes.
|
||||
it.truncated = g.Runes
|
||||
it.truncated = int(g.Runes)
|
||||
}
|
||||
if g.Flags&text.FlagLineBreak != 0 {
|
||||
it.linesSeen++
|
||||
|
||||
Reference in New Issue
Block a user