From 63c9e3ec8b51a9d96872a054a0d35e8591b3535d Mon Sep 17 00:00:00 2001 From: Kae <80987908+Novaenia@users.noreply.github.com> Date: Mon, 15 Apr 2024 17:46:44 +1000 Subject: only round vertices if AA is on [skip ci] --- source/rendering/StarDrawablePainter.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'source/rendering/StarDrawablePainter.cpp') diff --git a/source/rendering/StarDrawablePainter.cpp b/source/rendering/StarDrawablePainter.cpp index 5f9fd79..88ca651 100644 --- a/source/rendering/StarDrawablePainter.cpp +++ b/source/rendering/StarDrawablePainter.cpp @@ -36,15 +36,13 @@ void DrawablePainter::drawDrawable(Drawable const& drawable) { } else if (auto imagePart = drawable.part.ptr()) { TexturePtr texture = m_textureGroup->loadTexture(imagePart->image); + Vec2F position = drawable.position; Vec2F textureSize(texture->size()); - RectF imageRect(Vec2F(), textureSize); - - Mat3F transformation = Mat3F::translation(drawable.position) * imagePart->transformation; - - Vec2F lowerLeft = transformation.transformVec2(Vec2F(imageRect.xMin(), imageRect.yMin())); - Vec2F lowerRight = transformation.transformVec2(Vec2F(imageRect.xMax(), imageRect.yMin())); - Vec2F upperRight = transformation.transformVec2(Vec2F(imageRect.xMax(), imageRect.yMax())); - Vec2F upperLeft = transformation.transformVec2(Vec2F(imageRect.xMin(), imageRect.yMax())); + Mat3F transformation = imagePart->transformation; + Vec2F lowerLeft = { transformation[0][2] += position.x(), transformation[1][2] += position.y() }; + Vec2F lowerRight = transformation * Vec2F(textureSize.x(), 0.f); + Vec2F upperRight = transformation * textureSize; + Vec2F upperLeft = transformation * Vec2F(0.f, textureSize.y()); float param1 = drawable.fullbright ? 0.0f : 1.0f; -- cgit v1.2.3