@@ -153,16 +153,16 @@ public void paintComponent(Graphics screen) {
153
153
154
154
Graphics g = offscreen .getGraphics ();
155
155
if (font == null ) {
156
- font = Theme .getFont ("header.text.font" );
156
+ font = Theme .getDefaultFont (); // Get optimal font.
157
+ if (font == null ) font = Theme .getFont ("header.text.font" );
157
158
}
159
+
158
160
g .setFont (font ); // need to set this each time through
159
161
metrics = g .getFontMetrics ();
160
162
fontAscent = metrics .getAscent ();
161
163
//}
162
164
163
- //Graphics2D g2 = (Graphics2D) g;
164
- //g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
165
- // RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
165
+ Graphics2D g2 = (Graphics2D ) g ;
166
166
167
167
// set the background for the offscreen
168
168
g .setColor (backgroundColor );
@@ -182,9 +182,8 @@ public void paintComponent(Graphics screen) {
182
182
code .getPrettyName () : code .getFileName ();
183
183
184
184
// if modified, add the li'l glyph next to the name
185
- String text = " " + codeName + ( code . isModified () ? " \u00A7 " : " " ) ;
185
+ String text = " " + codeName + " " ;
186
186
187
- Graphics2D g2 = (Graphics2D ) g ;
188
187
int textWidth = (int )
189
188
font .getStringBounds (text , g2 .getFontRenderContext ()).getWidth ();
190
189
@@ -207,7 +206,16 @@ public void paintComponent(Graphics screen) {
207
206
g .setColor (textColor [state ]);
208
207
int baseline = (sizeH + fontAscent ) / 2 ;
209
208
//g.drawString(sketch.code[i].name, textLeft, baseline);
209
+
210
+ g2 .setRenderingHint (RenderingHints .KEY_TEXT_ANTIALIASING ,
211
+ RenderingHints .VALUE_TEXT_ANTIALIAS_ON );
212
+
210
213
g .drawString (text , textLeft , baseline );
214
+
215
+ if (code .isModified ()){
216
+ g .setColor (Color .RED );
217
+ g .drawString ("*" , textLeft - 3 , baseline );
218
+ }
211
219
212
220
g .drawImage (pieces [state ][RIGHT ], x , 0 , null );
213
221
x += PIECE_WIDTH - 1 ; // overlap by 1 pixel
0 commit comments