mirror of
https://github.com/flutter/flutter
synced 2024-10-13 19:52:53 +00:00
Update inaccurate documentation for isUtf16Surrogate method (#60219)
This commit is contained in:
parent
f8c9e1bb67
commit
42e67550af
|
@ -601,8 +601,11 @@ class TextPainter {
|
|||
canvas.drawParagraph(_paragraph, offset);
|
||||
}
|
||||
|
||||
// Complex glyphs can be represented by two or more UTF16 codepoints. This
|
||||
// checks if the value represents a UTF16 glyph by itself or is a 'surrogate'.
|
||||
// Returns true iff the given value is a valid UTF-16 surrogate. The value
|
||||
// must be a UTF-16 code unit, meaning it must be in the range 0x0000-0xFFFF.
|
||||
//
|
||||
// See also:
|
||||
// * https://en.wikipedia.org/wiki/UTF-16#Code_points_from_U+010000_to_U+10FFFF
|
||||
static bool _isUtf16Surrogate(int value) {
|
||||
return value & 0xF800 == 0xD800;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue