Skip to content

Commit

Permalink
Fix: Refresh Preview after Mapping altered
Browse files Browse the repository at this point in the history
Change: "please wait..." is drawn horizontally centered
Change: Preview is rendered with AntiAliasing
Added: icon
  • Loading branch information
t-oster committed Sep 17, 2011
1 parent 5f08853 commit e449f6a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Binary file added icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 5 additions & 2 deletions src/com/t_oster/visicut/gui/beans/PreviewPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ private BufferedImage renderMapping(Mapping m)
LaserProfile p = PreviewPanel.this.getMaterial().getLaserProfile(m.getProfileName());
buffer = new BufferedImage((int) bb.getWidth(), (int) bb.getHeight(), BufferedImage.TYPE_INT_ARGB);
Graphics2D gg = buffer.createGraphics();
gg.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
//Normalize Rendering to 0,0
gg.setTransform(AffineTransform.getTranslateInstance(-bb.getX(), -bb.getY()));
p.renderPreview(gg, set, PreviewPanel.this.getMaterial());
Expand Down Expand Up @@ -429,9 +430,10 @@ protected void paintComponent(Graphics g)
gg.setColor(Color.BLACK);
AffineTransform tmp = gg.getTransform();
gg.setTransform(new AffineTransform());
Point p = new Point(r.x, r.y + r.height / 2);
Point p = new Point(r.x+r.width/2, r.y + r.height / 2);
tmp.transform(p, p);
gg.drawString("please wait...", p.x, p.y);
int w = gg.getFontMetrics().stringWidth("please wait...");
gg.drawString("please wait...", p.x-w/2, p.y);
gg.setTransform(tmp);
}
else
Expand Down Expand Up @@ -509,6 +511,7 @@ public List<Mapping> getMappings()
public void setMappings(List<Mapping> mappings)
{
this.mappings = mappings;
this.renderBuffer.clear();
this.repaint();
}

Expand Down

0 comments on commit e449f6a

Please sign in to comment.