mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-26 15:53:35 +01:00
GPU: Keep diagonal lines the same width.
This commit is contained in:
1 parent
60bd25582c
commit
76e1690646
1 file changed
+7
-3
@@ -796,9 +796,13 @@ void SoftwareTransform::ExpandLines(int vertexCount, int &maxIndex, u16 *&inds,
|
||||
TransformedVertex transVtxBL = transformed[indsIn[i + 1]];
|
||||
|
||||
// Okay, let's calculate the perpendicular biased toward the bottom right.
|
||||
float horizontal = fabsf(transVtxTL.x - transVtxBL.x);
|
||||
float vertical = fabsf(transVtxTL.y - transVtxBL.y);
|
||||
Vec2f addWidth = Vec2f(vertical, horizontal).Normalized();
|
||||
float horizontal = transVtxTL.x - transVtxBL.x;
|
||||
float vertical = transVtxTL.y - transVtxBL.y;
|
||||
Vec2f addWidth = Vec2f(-vertical, horizontal).Normalized();
|
||||
// We'll bias mostly straight lines and try to keep diagonal lines at 90 degrees.
|
||||
if (fabsf(addWidth.y) < fabsf(addWidth.x / 16.0f)) {
|
||||
addWidth.x = -addWidth.x;
|
||||
}
|
||||
|
||||
// bottom right
|
||||
trans[0] = transVtxBL;
|
||||
|
||||
Reference in new issue
Block a user