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

Commit b5ab4173 authored by Romain Guy's avatar Romain Guy
Browse files

Fix positioning of 1 pixel wide lines (esp. non AA lines.)

Change-Id: Ic155cac72f351edae35dffdfbb236954f57ba7de
parent c95c8d6b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -93,7 +93,7 @@ public:
                mXDivs, mYDivs, mXDivsCount, mYDivsCount);

        tx = -gLineAABias;
        ty = lineWidth == 1.0f ? -gLineAABias : -half - gLineAABias;
        ty = lineWidth <= 1.0f ? -gLineAABias : -half - gLineAABias;
    }

    inline GLvoid* getVertices() const {
+1 −1
Original line number Diff line number Diff line
@@ -633,7 +633,7 @@ void OpenGLRenderer::drawLines(float* points, int count, const SkPaint* paint) {
            mLine.update(points[i], points[i + 1], points[i + 2], points[i + 3],
                    strokeWidth, tx, ty);
        } else {
            ty = -strokeWidth * 0.5f;
            ty = strokeWidth <= 1.0f ? 0.0f : -strokeWidth * 0.5f;
        }

        const float dx = points[i + 2] - points[i];