Update inaccurate documentation for isUtf16Surrogate method (#60219)

This commit is contained in:
Justin McCandless 2020-06-24 12:18:02 -07:00 committed by GitHub
parent f8c9e1bb67
commit 42e67550af
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;
}