Removed grounditems.fontStyle option

This commit is contained in:
CalebWhiting
2019-03-14 13:13:30 +00:00
committed by BuildTools
parent 1f45546dc9
commit dd2c351218
3 changed files with 10 additions and 21 deletions

View File

@@ -30,7 +30,6 @@ import net.runelite.client.config.Alpha;
import net.runelite.client.config.Config;
import net.runelite.client.config.ConfigGroup;
import net.runelite.client.config.ConfigItem;
import net.runelite.client.config.FontType;
import net.runelite.client.plugins.grounditems.config.ItemHighlightMode;
import net.runelite.client.plugins.grounditems.config.MenuHighlightMode;
import net.runelite.client.plugins.grounditems.config.PriceDisplayMode;
@@ -356,14 +355,4 @@ public interface GroundItemsConfig extends Config
return false;
}
@ConfigItem(
keyName = "fontType",
name = "Font type",
description = "Configures the font type to use when drawing items",
position = 27
)
default FontType fontStyle()
{
return FontType.REGULAR;
}
}

View File

@@ -27,7 +27,6 @@ package net.runelite.client.plugins.grounditems;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.FontMetrics;
import java.awt.Graphics2D;
import java.awt.Polygon;
@@ -102,11 +101,6 @@ public class GroundItemsOverlay extends Overlay
return null;
}
final Font originalFont = graphics.getFont();
final Font font = config.fontStyle().getFont();
graphics.setFont(font);
final FontMetrics fm = graphics.getFontMetrics();
offsetMap.clear();
@@ -344,9 +338,6 @@ public class GroundItemsOverlay extends Overlay
textComponent.setPosition(new java.awt.Point(textX, textY));
textComponent.render(graphics);
}
graphics.setFont(originalFont);
return null;
}

View File

@@ -27,17 +27,19 @@ package net.runelite.client.ui.overlay.components;
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
public class TextComponentTest
{
private Graphics2D graphics;
private BufferedImage dest;
@Before
public void before()
{
BufferedImage dest = new BufferedImage(1, 1, BufferedImage.TYPE_INT_RGB);
dest = new BufferedImage(1, 1, BufferedImage.TYPE_INT_RGB);
graphics = (Graphics2D) dest.getGraphics();
}
@@ -65,4 +67,11 @@ public class TextComponentTest
textComponent.setText("<col=0000ff>test<col=00ff00> test");
textComponent.render(graphics);
}
@After
public void after() {
graphics.dispose();
dest.flush();
}
}