Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 2de2458

Browse files
oops
1 parent fdc3f54 commit 2de2458

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

lib/web_ui/lib/src/engine/text/layout_fragmenter.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -686,6 +686,7 @@ mixin _FragmentBox on _CombinedFragment, _FragmentMetrics, _FragmentPosition {
686686
end: start + _graphemeStarts[endIndex],
687687
),
688688
};
689+
assert(!range.isCollapsed, '$range must not be collapsed. $_graphemeStarts[$startIndex, $endIndex]');
689690
final ui.TextBox box = toTextBox(start: range.start, end: range.end);
690691
return ui.GlyphInfo(box.toRect(), range, box.direction);
691692
}

lib/web_ui/skwasm/text/paragraph.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ SKWASM_EXPORT bool paragraph_getClosestGlyphInfoAtCoordinate(
7070
bool* booleanFlags) {
7171
Paragraph::GlyphInfo glyphInfo;
7272
if (!paragraph->getClosestUTF16GlyphInfoAt(offsetX, offsetY, &glyphInfo)) {
73-
delete glyphInfo;
7473
return false;
7574
}
7675
// This is more verbose than memcpying the whole struct but ideally we don't
@@ -91,7 +90,6 @@ SKWASM_EXPORT bool paragraph_getGlyphInfoAt(Paragraph* paragraph,
9190
bool* booleanFlags) {
9291
Paragraph::GlyphInfo glyphInfo;
9392
if (!paragraph->getGlyphInfoAtUTF16Offset(index, &glyphInfo)) {
94-
delete glyphInfo;
9593
return false;
9694
}
9795
std::memcpy(graphemeLayoutBounds, &glyphInfo.fGraphemeLayoutBounds,

lib/web_ui/test/html/text_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ Future<void> testMain() async {
117117

118118
test('Basic glyph metrics', () {
119119
const double fontSize = 10;
120-
final ParagraphBuilder builder = ParagraphBuilder(CkParagraphStyle(
120+
final ParagraphBuilder builder = ParagraphBuilder(ParagraphStyle(
121121
fontStyle: FontStyle.normal,
122122
fontWeight: FontWeight.normal,
123123
fontSize: fontSize,
@@ -138,7 +138,7 @@ Future<void> testMain() async {
138138

139139
test('Basic glyph metrics - hit test', () {
140140
const double fontSize = 10.0;
141-
final ParagraphBuilder builder = ParagraphBuilder(CkParagraphStyle(
141+
final ParagraphBuilder builder = ParagraphBuilder(ParagraphStyle(
142142
fontSize: fontSize,
143143
fontFamily: 'FlutterTest',
144144
))..addText('Test\nTest');

0 commit comments

Comments
 (0)