Skip to content

Commit

Permalink
overlayutil: reset stroke for renderpolygon
Browse files Browse the repository at this point in the history
If a plugin used a combination of renderPolygon and either use other
util methods or draw on their own on the same graphics object, the
stroke would get applied as well.
  • Loading branch information
jplsek committed May 13, 2018
1 parent aa35b2c commit 651d259
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import java.awt.Graphics2D;
import java.awt.Polygon;
import java.awt.RenderingHints;
import java.awt.Stroke;
import java.awt.geom.Area;
import java.awt.image.BufferedImage;
import net.runelite.api.Actor;
Expand All @@ -48,10 +49,12 @@ public class OverlayUtil
public static void renderPolygon(Graphics2D graphics, Polygon poly, Color color)
{
graphics.setColor(color);
final Stroke originalStroke = graphics.getStroke();
graphics.setStroke(new BasicStroke(2));
graphics.drawPolygon(poly);
graphics.setColor(new Color(0, 0, 0, 50));
graphics.fillPolygon(poly);
graphics.setStroke(originalStroke);
}

public static void renderMinimapLocation(Graphics2D graphics, Point mini, Color color)
Expand Down

0 comments on commit 651d259

Please sign in to comment.