Commit a9140b77 authored by Rob Buis's avatar Rob Buis Committed by Commit Bot

[mathml] Properly initialize StretchyOperatorShaper::Metrics

Properly initialize StretchyOperatorShaper::Metrics in the struct,
instead of having to initialize the struct at point of use. This comes
out of a discussion of this CL:
https://chromium-review.googlesource.com/c/chromium/src/+/2270448

Bug: 6606
Change-Id: I1f00753ea25ce8de18e853729cb90e72a7e04e61
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2275954Reviewed-by: default avatarChristian Biesinger <cbiesinger@chromium.org>
Reviewed-by: default avatarDominik Röttsches <drott@chromium.org>
Commit-Queue: Rob Buis <rbuis@igalia.com>
Cr-Commit-Position: refs/heads/master@{#785306}
parent fd3b3910
......@@ -120,7 +120,7 @@ scoped_refptr<const NGLayoutResult> NGMathRadicalLayoutAlgorithm::Layout() {
std::max(horizontal.kern_after_degree, -index_inline_size);
}
StretchyOperatorShaper::Metrics surd_metrics = {};
StretchyOperatorShaper::Metrics surd_metrics;
if (HasBaseGlyphForRadical(Style())) {
// Stretch the radical operator to cover the base height.
StretchyOperatorShaper shaper(kSquareRootCharacter,
......
......@@ -31,10 +31,10 @@ class PLATFORM_EXPORT StretchyOperatorShaper final {
: stretchy_character_(stretchy_character), stretch_axis_(stretch_axis) {}
struct Metrics {
float advance;
float ascent;
float descent;
float italic_correction;
float advance { 0.0f };
float ascent { 0.0f };
float descent { 0.0f };
float italic_correction { 0.0f };
};
// Shape the stretched operator. The coordinates of the glyph(s) use the same
// origin as the rectangle assigned to the optional OUT Metrics parameter.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment