Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
private void addCrossHatch( Graphics graphics, int width, int height, int x, int y ) {
graphics.setColor( Color.BLACK );
graphics.drawLine( x, y, x + width, y + height );
graphics.drawLine( x + ( width / 2 ), y, x + width, y + ( height / 2 ) );
graphics.drawLine( x, y + ( height / 2 ), x + ( width / 2 ), y + height );
graphics.drawLine( x, y + (int) ( height * .6 ), x + (int) ( width * .6 ), y );
graphics.drawLine( x + (int) ( width * .4 ), y + height, x + width, y + (int) ( height * .4 ) );
graphics.drawRect( x, y, width, height );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment