forked from External/mage
Don't call setText in MageTextArea if the text hasn't changed
Minor UI speedup, shows up in profiles for simple games.
This commit is contained in:
parent
8c2c1f4887
commit
9513b5bf74
1 changed files with 8 additions and 0 deletions
|
|
@ -13,6 +13,8 @@ import org.mage.card.arcane.UI;
|
|||
* @author nantuko
|
||||
*/
|
||||
public class MageTextArea extends JEditorPane {
|
||||
private String currentText;
|
||||
private int currentPanelWidth;
|
||||
|
||||
public MageTextArea() {
|
||||
UI.setHTMLEditorKit(this);
|
||||
|
|
@ -31,6 +33,12 @@ public class MageTextArea extends JEditorPane {
|
|||
return;
|
||||
}
|
||||
|
||||
if(text.equals(currentText) && panelWidth == currentPanelWidth)
|
||||
return;
|
||||
|
||||
currentText = text;
|
||||
currentPanelWidth = panelWidth;
|
||||
|
||||
final StringBuilder buffer = new StringBuilder(512);
|
||||
// Dialog is a java logical font family, so it should work on all systems
|
||||
buffer.append("<html><body style='font-family:Dialog;font-size:");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue