ground markers: add fill opacity config
This commit is contained in:
@@ -98,4 +98,14 @@ public interface GroundMarkerConfig extends Config
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
|
||||
@ConfigItem(
|
||||
keyName = "fillOpacity",
|
||||
name = "Fill Opacity",
|
||||
description = "Opacity of the tile fill color"
|
||||
)
|
||||
default int fillOpacity()
|
||||
{
|
||||
return 50;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@ public class GroundMarkerOverlay extends Overlay
|
||||
Polygon poly = Perspective.getCanvasTilePoly(client, lp);
|
||||
if (poly != null)
|
||||
{
|
||||
OverlayUtil.renderPolygon(graphics, poly, color, borderStroke);
|
||||
OverlayUtil.renderPolygon(graphics, poly, color, new Color(0, 0, 0, config.fillOpacity()), borderStroke);
|
||||
}
|
||||
|
||||
if (!Strings.isNullOrEmpty(label))
|
||||
|
||||
@@ -54,12 +54,17 @@ public class OverlayUtil
|
||||
}
|
||||
|
||||
public static void renderPolygon(Graphics2D graphics, Shape poly, Color color, Stroke borderStroke)
|
||||
{
|
||||
renderPolygon(graphics, poly, color, new Color(0, 0, 0, 50), borderStroke);
|
||||
}
|
||||
|
||||
public static void renderPolygon(Graphics2D graphics, Shape poly, Color color, Color fillColor, Stroke borderStroke)
|
||||
{
|
||||
graphics.setColor(color);
|
||||
final Stroke originalStroke = graphics.getStroke();
|
||||
graphics.setStroke(borderStroke);
|
||||
graphics.draw(poly);
|
||||
graphics.setColor(new Color(0, 0, 0, 50));
|
||||
graphics.setColor(fillColor);
|
||||
graphics.fill(poly);
|
||||
graphics.setStroke(originalStroke);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user