Reputation: 435
Graphics2D's drawImage() method requires strictly integers.
How could one draw an image using floating points in Java2D, if at all?
If not what would SO recommend?
Upvotes: 1
Views: 391
Reputation: 6780
You can't - the screen is partitioned into pixels, which are represented as integers. You physically cant tell the screen to draw something at half a pixel because that's not how screens work.
The best solution is just to round your float to the nearest integer and draw the object there.
Upvotes: 1