FileDocCategorySizeDatePackage
Clipped.javaAPI DocExample745Wed Mar 26 01:23:16 GMT 1997None

Clipped

public class Clipped extends TerribleFlicker

Fields Summary
int
nextX
int
nextY
Constructors Summary
Methods Summary
voidclipToAffectedArea(java.awt.Graphics g, int oldx, int oldy, int newx, int newy, int width, int height)

		int x = Math.min( oldx, newx );
		int y = Math.min( oldy, newy );
		int w = ( Math.max( oldx, newx ) + width ) - x;
		int h = ( Math.max( oldy, newy ) + height ) - y;
		g.setClip( x, y, w, h );
	
public voidmouseDragged(java.awt.event.MouseEvent e)

		nextX = e.getX(); nextY = e.getY();
		repaint();
	
public voidupdate(java.awt.Graphics g)

		int lastX = currentX, lastY = currentY;
		currentX = nextX; currentY = nextY;
		clipToAffectedArea( g, lastX, lastY, currentX, currentY, imgWidth, imgHeight );
		paint( g );