No Graphics::drawImage on float destination coordinates?


Is there a reason there’s no float version of drawImage?

void Graphics::drawImage (const Image& imageToDraw,
                          int dx, int dy, int dw, int dh,
                          int sx, int sy, int sw, int sh,
                          const bool fillAlphaChannelWithCurrentBrush)

It looks like drawImage uses drawImageTransformed which accepts an AffineTransform which is made from floats.

Obviously, the source coordinates are fine being ints, but shouldn’t the dx, dy, dw & dh be floats?


I think there are a few graphics methods like that where it could use an update (but preferable to change it to use a Rectangle than just adding a raw floats version)


Why not both? The code looks trivial and not prone to error.

I would prefer a float version as there already seems to be int and float versions of many other Graphics functions and it would be a simple replacement.


Using Point/Rectangle forces you to write less messy code - if I’d been a bit more experienced 15 years ago when I started that class, I’d have avoided the loose int parameters altogether!



I thought it would be trivial to make a float version but then I noticed that all the clipping code is using ints.