Commit 0a5cf28b authored by kirandjiska's avatar kirandjiska

temp commit

parent 7484167d
......@@ -1612,9 +1612,19 @@ public class ConstraintsSelectionDialog extends JInternalFrame implements Zoomab
@Override
public Image getMatchingImage(int x, int y, int width, int height, float zoom) {
BufferedImage subImage = this.getDisplayedImage().getSubimage(x, y, width, height);
// coordinates in original image
int xo = (int) (x/mZoomRate);
int yo = (int) (y/mZoomRate);
int widthOrigin = (int) (width/mZoomRate);
int heightOrigin= (int) (height/mZoomRate);
float zoomOrigin = zoom*mZoomRate ;
// BufferedImage subImage = this.getDisplayedImage().getSubimage(x, y, width, height);
BufferedImage subImage = this.getOriginalImage().getSubimage(xo, yo, widthOrigin, heightOrigin);
return subImage.getScaledInstance((int) (width * zoom), (int) (height *zoom ), Image.SCALE_SMOOTH);
return subImage.getScaledInstance((int) (widthOrigin * zoomOrigin), (int) (heightOrigin *zoomOrigin ), Image.SCALE_SMOOTH);
}
public BufferedImage getOriginalImage() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment