Baseline for empty text
Change-Id: I7c172bfb8f35f684030489f75cd997acdbbe3a75
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/220298
Commit-Queue: Julia Lavrova <jlavrova@google.com>
Reviewed-by: Herb Derby <herb@google.com>
diff --git a/samplecode/SampleParagraph.cpp b/samplecode/SampleParagraph.cpp
index 9a9e228..8407c42 100644
--- a/samplecode/SampleParagraph.cpp
+++ b/samplecode/SampleParagraph.cpp
@@ -1292,21 +1292,7 @@
void onDrawContent(SkCanvas* canvas) override {
canvas->drawColor(SK_ColorWHITE);
- const char* text =
- "😀😃😄😁😆😅😂🤣☺😇🙂😍😡😟😢😻👽💩👍👎🙏👌👋👄👁👦👼👨🚀👨🚒🙋♂️👳👨👨👧"
- ""
- "👧"
- "💼👡👠☂🐶🐰🐻🐼🐷🐒🐵🐔🐧🐦🐋🐟🐡🕸🐌🐴🐊🐄🐪🐘🌸🌏🔥🌟🌚🌝"
- "💦"
- "💧"
- "❄🍕🍔🍟🥝🍱🕶🎩🏈⚽🚴♀️🎻🎼🎹🚨🚎🚐⚓🛳🚀🚁🏪🏢🖱⏰📱💾💉📉🛏"
- "🔑"
- "🔓"
- "📁🗓📊❤💯🚫🔻♠♣🕓❗🏳🏁🏳️🌈🇮🇹🇱🇷🇺🇸🇬🇧🇨🇳"
- "🇧"
- "🇴";
- text = "🍀\0";
- text = "qwerty ";
+ const char* text = "\n";
ParagraphStyle paragraph_style;
paragraph_style.turnHintingOff();
@@ -1323,7 +1309,8 @@
auto paragraph = builder.Build();
paragraph->layout(1000);
- auto result = paragraph->getRectsForRange(6, 10, RectHeightStyle::kTight, RectWidthStyle::kTight);
+ auto result =
+ paragraph->getRectsForRange(0, 1, RectHeightStyle::kTight, RectWidthStyle::kTight);
SkPaint paint;
paint.setColor(SK_ColorLTGRAY);
canvas->drawRect(result[0].rect, paint);