Use round rather than floor for snapping text vertex positions

Bug: skia:
Change-Id: I37e93657a692a7cea49029f8694418b827dc19d5
Reviewed-on: https://skia-review.googlesource.com/70181
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This commit is contained in:
Brian Osman 2017-11-10 15:31:27 -05:00 committed by Skia Commit-Bot
parent 096d4467d9
commit 7ca90d2580

View File

@ -84,10 +84,10 @@ static void clip_quads(const SkIRect& clipRect, char* currVertex, const char* bl
reinterpret_cast<const SkPoint*>(blobVertices + 3 * vertexStride);
// positions for bitmap glyphs are pixel boundary aligned
SkIRect positionRect = SkIRect::MakeLTRB(SkScalarFloorToInt(blobPositionLT->fX),
SkScalarFloorToInt(blobPositionLT->fY),
SkScalarFloorToInt(blobPositionRB->fX),
SkScalarFloorToInt(blobPositionRB->fY));
SkIRect positionRect = SkIRect::MakeLTRB(SkScalarRoundToInt(blobPositionLT->fX),
SkScalarRoundToInt(blobPositionLT->fY),
SkScalarRoundToInt(blobPositionRB->fX),
SkScalarRoundToInt(blobPositionRB->fY));
if (clipRect.contains(positionRect)) {
memcpy(currVertex, blobVertices, 4 * vertexStride);
currVertex += 4 * vertexStride;