Relative Content

Tag Archive for javaswinggraphics2d

Java Graphics2D fillRect creating wrongly sized squares with a pattern

I am having an issue with a custom drawn image rendered on the JPanel with Graphics2D. If I try to draw a 1×1 pixel for every x/y the width and length of the panel with fillRect it will create a bunch of different sized rects of 1×1, 1×2, and 2×2 in a pattern. I’ve tried playing with the Graphics2D rendering hints but could not figure out what is causing this to happen.