Skip to content

Commit e449f6a

Browse files
committed
Fix: Refresh Preview after Mapping altered
Change: "please wait..." is drawn horizontally centered Change: Preview is rendered with AntiAliasing Added: icon
1 parent 5f08853 commit e449f6a

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

Diff for: icon.png

12.5 KB
Loading

Diff for: src/com/t_oster/visicut/gui/beans/PreviewPanel.java

+5-2
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ private BufferedImage renderMapping(Mapping m)
7272
LaserProfile p = PreviewPanel.this.getMaterial().getLaserProfile(m.getProfileName());
7373
buffer = new BufferedImage((int) bb.getWidth(), (int) bb.getHeight(), BufferedImage.TYPE_INT_ARGB);
7474
Graphics2D gg = buffer.createGraphics();
75+
gg.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
7576
//Normalize Rendering to 0,0
7677
gg.setTransform(AffineTransform.getTranslateInstance(-bb.getX(), -bb.getY()));
7778
p.renderPreview(gg, set, PreviewPanel.this.getMaterial());
@@ -429,9 +430,10 @@ protected void paintComponent(Graphics g)
429430
gg.setColor(Color.BLACK);
430431
AffineTransform tmp = gg.getTransform();
431432
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);
433434
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);
435437
gg.setTransform(tmp);
436438
}
437439
else
@@ -509,6 +511,7 @@ public List<Mapping> getMappings()
509511
public void setMappings(List<Mapping> mappings)
510512
{
511513
this.mappings = mappings;
514+
this.renderBuffer.clear();
512515
this.repaint();
513516
}
514517

0 commit comments

Comments
 (0)