progress bar: optimize bar drawing

It is not necessary to draw the full bar background since it is immediately drawn over by the foreground
This commit is contained in:
Adam
2020-10-17 19:36:36 -04:00
parent 9214480a02
commit 6457681c55

View File

@@ -114,7 +114,7 @@ public class ProgressBarComponent implements LayoutableRenderableEntity
// Draw bar
graphics.setColor(backgroundColor);
graphics.fillRect(barX, barY, width, height);
graphics.fillRect(barX + progressFill, barY, width - progressFill, height);
graphics.setColor(foregroundColor);
graphics.fillRect(barX, barY, progressFill, height);