@@ -72,6 +72,7 @@ private BufferedImage renderMapping(Mapping m)
72
72
LaserProfile p = PreviewPanel .this .getMaterial ().getLaserProfile (m .getProfileName ());
73
73
buffer = new BufferedImage ((int ) bb .getWidth (), (int ) bb .getHeight (), BufferedImage .TYPE_INT_ARGB );
74
74
Graphics2D gg = buffer .createGraphics ();
75
+ gg .setRenderingHint (RenderingHints .KEY_ANTIALIASING , RenderingHints .VALUE_ANTIALIAS_ON );
75
76
//Normalize Rendering to 0,0
76
77
gg .setTransform (AffineTransform .getTranslateInstance (-bb .getX (), -bb .getY ()));
77
78
p .renderPreview (gg , set , PreviewPanel .this .getMaterial ());
@@ -429,9 +430,10 @@ protected void paintComponent(Graphics g)
429
430
gg .setColor (Color .BLACK );
430
431
AffineTransform tmp = gg .getTransform ();
431
432
gg .setTransform (new AffineTransform ());
432
- Point p = new Point (r .x , r .y + r .height / 2 );
433
+ Point p = new Point (r .x + r . width / 2 , r .y + r .height / 2 );
433
434
tmp .transform (p , p );
434
- gg .drawString ("please wait..." , p .x , p .y );
435
+ int w = gg .getFontMetrics ().stringWidth ("please wait..." );
436
+ gg .drawString ("please wait..." , p .x -w /2 , p .y );
435
437
gg .setTransform (tmp );
436
438
}
437
439
else
@@ -509,6 +511,7 @@ public List<Mapping> getMappings()
509
511
public void setMappings (List <Mapping > mappings )
510
512
{
511
513
this .mappings = mappings ;
514
+ this .renderBuffer .clear ();
512
515
this .repaint ();
513
516
}
514
517
0 commit comments