Check if infobox can render in InfoBoxOverlay

Infoboxes have property render that needs to be checked in
InfoBoxOverlay.

Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
This commit is contained in:
Tomas Slusny
2018-06-21 11:26:16 +02:00
committed by Adam
parent 2b925d653e
commit 0223206994

View File

@@ -89,15 +89,20 @@ public class InfoBoxOverlay extends Overlay
: PanelComponent.Orientation.HORIZONTAL);
panelComponent.setPreferredSize(new Dimension(config.infoBoxSize(), config.infoBoxSize()));
infoBoxes.forEach(box ->
for (InfoBox box : infoBoxes)
{
if (!box.render())
{
continue;
}
final InfoBoxComponent infoBoxComponent = new InfoBoxComponent();
infoBoxComponent.setColor(box.getTextColor());
infoBoxComponent.setImage(box.getScaledImage());
infoBoxComponent.setText(box.getText());
infoBoxComponent.setTooltip(box.getTooltip());
panelComponent.getChildren().add(infoBoxComponent);
});
}
final Dimension dimension = panelComponent.render(graphics);
final Client client = clientProvider.get();