Skip to content

Commit 14c1a3a

Browse files
committed
The ISO Triangle shape would skip rendering the left side of the first triangle in the batch. It now renders all ISO Triangles correctly. Fix phaserjs#5164
1 parent 4da8361 commit 14c1a3a

1 file changed

Lines changed: 16 additions & 14 deletions

File tree

src/gameobjects/shape/isotriangle/IsoTriangleWebGLRenderer.js

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -86,18 +86,18 @@ var IsoTriangleWebGLRenderer = function (renderer, src, interpolationPercentage,
8686

8787
x0 = calcMatrix.getX(-sizeA, -height);
8888
y0 = calcMatrix.getY(-sizeA, -height);
89-
89+
9090
x1 = calcMatrix.getX(0, -sizeB - height);
9191
y1 = calcMatrix.getY(0, -sizeB - height);
92-
92+
9393
x2 = calcMatrix.getX(sizeA, -height);
9494
y2 = calcMatrix.getY(sizeA, -height);
95-
95+
9696
var x3 = calcMatrix.getX(0, sizeB - height);
9797
var y3 = calcMatrix.getY(0, sizeB - height);
9898

9999
pipeline.setTexture2D();
100-
100+
101101
pipeline.batchQuad(x0, y0, x1, y1, x2, y2, x3, y3, 0, 0, 1, 1, tint, tint, tint, tint, 2);
102102
}
103103

@@ -111,25 +111,27 @@ var IsoTriangleWebGLRenderer = function (renderer, src, interpolationPercentage,
111111
{
112112
x0 = calcMatrix.getX(-sizeA, -height);
113113
y0 = calcMatrix.getY(-sizeA, -height);
114-
114+
115115
x1 = calcMatrix.getX(0, sizeB);
116116
y1 = calcMatrix.getY(0, sizeB);
117-
117+
118118
x2 = calcMatrix.getX(0, sizeB - height);
119119
y2 = calcMatrix.getY(0, sizeB - height);
120120
}
121121
else
122122
{
123123
x0 = calcMatrix.getX(-sizeA, 0);
124124
y0 = calcMatrix.getY(-sizeA, 0);
125-
125+
126126
x1 = calcMatrix.getX(0, sizeB);
127127
y1 = calcMatrix.getY(0, sizeB);
128-
128+
129129
x2 = calcMatrix.getX(0, sizeB - height);
130130
y2 = calcMatrix.getY(0, sizeB - height);
131131
}
132-
132+
133+
pipeline.setTexture2D();
134+
133135
pipeline.batchTri(x0, y0, x1, y1, x2, y2, 0, 0, 1, 1, tint, tint, tint, 2);
134136
}
135137

@@ -143,27 +145,27 @@ var IsoTriangleWebGLRenderer = function (renderer, src, interpolationPercentage,
143145
{
144146
x0 = calcMatrix.getX(sizeA, -height);
145147
y0 = calcMatrix.getY(sizeA, -height);
146-
148+
147149
x1 = calcMatrix.getX(0, sizeB);
148150
y1 = calcMatrix.getY(0, sizeB);
149-
151+
150152
x2 = calcMatrix.getX(0, sizeB - height);
151153
y2 = calcMatrix.getY(0, sizeB - height);
152154
}
153155
else
154156
{
155157
x0 = calcMatrix.getX(sizeA, 0);
156158
y0 = calcMatrix.getY(sizeA, 0);
157-
159+
158160
x1 = calcMatrix.getX(0, sizeB);
159161
y1 = calcMatrix.getY(0, sizeB);
160-
162+
161163
x2 = calcMatrix.getX(0, sizeB - height);
162164
y2 = calcMatrix.getY(0, sizeB - height);
163165
}
164166

165167
pipeline.setTexture2D();
166-
168+
167169
pipeline.batchTri(x0, y0, x1, y1, x2, y2, 0, 0, 1, 1, tint, tint, tint, 2);
168170
}
169171
};

0 commit comments

Comments
 (0)