fillCustomRect function
void
fillCustomRect()
Implementation
void fillCustomRect(
Image image,
int x0,
int y0,
int x1,
int y1,
int x2,
int y2,
int x3,
int y3,
int color,
) {
final minY = min(min(y0, y1), min(y2, y3));
final maxY = max(max(y0, y1), max(y2, y3));
final minX = min(min(x0, x1), min(x2, x3));
final maxX = max(max(x0, x1), max(x2, x3));
for (int x = minX; x <= maxX; x++) {
for (int y = minY; y <= maxY; y++) {
if (_isPointInRectangle(x0, y0, x1, y1, x2, y2, x, y)) {
drawPixel(image, x, y, color);
}
}
}
}