public void mouseClicked(MouseEvent e) {
		if (image !=null && image.getImage() != null && map!=null && image.getTile().size()>0) {
			if (e.getX()>=0 && e.getX() <width*zoom && e.getY() >= 0 && e.getY() < height*zoom) {
				int i=0;
			    Graphics ofg = offsetPaint.getGraphics();
				while((image.getTile().get(i++)) == -1) {
					if (i+1==image.getTile().size()) break;
				}
				i--;
				for (int v : image.getTile()) {
					if (v==-1) continue;
					int _x = (v-image.getTile().get(i)) % (image.getImage().getWidth()/(8*zoom));
					int _y = (v-image.getTile().get(i)) / (image.getImage().getWidth()/(8*zoom));
					
					if (_x+(e.getX() / (8*zoom))>=(width*zoom)/(8*zoom)) continue;
					if (_y+(e.getY() / (8*zoom))>=(height*zoom)/(8*zoom)) continue;
					int j = ((e.getX() / (8*zoom))+_x + (((e.getY()/(8*zoom))+_y)*((width*zoom)/(8*zoom))));
					map.set(j, v);
					ofg.drawImage( image.getImage().getSubimage((v % (image.getImage().getWidth()/(8*zoom)))*(8*zoom), (v / (image.getImage().getWidth()/(8*zoom))) * (8*zoom), (8*zoom), (8*zoom)), (j%(width/8))*(8*zoom), (j/(width/8))*(8*zoom), null);
				}
				refreshSelection=true;
				hystoryMem();
				repaint();
			}
		}	
	}