Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d84d2ee3 authored by Stan Iliev's avatar Stan Iliev
Browse files

Fix bound rectangle calculation in SkiaCanvasProxy::onDrawPosText

SkiaCanvasProxy::onDrawPosText was calculating wrong bound rectangle,
because the initial rectangle used to accumulate the result was not
initialized.

bug: 30357689
Change-Id: I2c2afd4645237c50a3fcf2bbd99ae1ce2cd911c1
parent 7068bfc3
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -323,9 +323,9 @@ void SkiaCanvasProxy::onDrawPosText(const void* text, size_t byteLength, const S
    // by Minikin then it had already computed these bounds.  Unfortunately,
    // there is no way to capture those bounds as part of the Skia drawPosText
    // API so we need to do that computation again here.
    SkRect bounds;
    SkRect bounds = SkRect::MakeEmpty();
    for (int i = 0; i < glyphs.count; i++) {
        SkRect glyphBounds;
        SkRect glyphBounds = SkRect::MakeEmpty();
        glyphs.paint.measureText(&glyphs.glyphIDs[i], sizeof(uint16_t), &glyphBounds);
        glyphBounds.offset(pos[i].fX, pos[i].fY);
        bounds.join(glyphBounds);