I get all these warnings about int being converted to float, and possible loss of precision. I don’t want to change all my int constants to floats. Why does this error appear? I thought float function parameters were promoted to double anyway? Why aren’t the arguments simply double?
Why can’t I pass a const Rectangle& where a const Rectangle& is expected? I thought they could be represented identically. For example, why can’t I do this:
Graphics g; g.drawRoundedRectangle( getLocalBounds(), 2, 1 );
As for the int to float, this happens every time I make a rectangle’s coordinates take on fractional values. For example:
Rectangle<int> r; g.drawRoundedRectangle( r.getX()+0.5, r.getY()+0.5, r.getWidth()-1, r.getHeight()-1 );
Through a template member function there should be a way to promote a Rectangle to a Rectangle (or Rectangle?):
Rectangle<int> r; g.fillRect( r.reduced( 0.25, 0.25 ) ); // promote to Rectangle<float>