void
renderTriangle(RenderState renderState, num x1, num y1, num x2, num y2, num x3, num y3, int color)
Source
@override
void renderTriangle(
RenderState renderState,
num x1, num y1, num x2, num y2, num x3, num y3, int color) {
var context = _renderingContext;
var matrix = renderState.globalMatrix;
var alpha = renderState.globalAlpha;
var blendMode = renderState.globalBlendMode;
if (_activeAlpha != alpha) {
_activeAlpha = alpha;
context.globalAlpha = alpha;
}
if (_activeBlendMode != blendMode) {
_activeBlendMode = blendMode;
context.globalCompositeOperation = blendMode.compositeOperation;
}
context.setTransform(matrix.a, matrix.b, matrix.c, matrix.d, matrix.tx, matrix.ty);
context.beginPath();
context.moveTo(x1, y1);
context.lineTo(x2, y2);
context.lineTo(x3, y3);
context.closePath();
context.fillStyle = color2rgba(color);
context.fill();
}