I would like to convert from a RectF to a Rect in Android. Currently I have:
RectF rectF = new RectF();
rectF.set( ... some values ... );
...
Rect rect = new Rect((int)rectF.left,
(int)rectF.top,
(int)rectF.right,
(int)rectF.bottom));
Is there a better way?
Ah ha -- found the answer:
rectF.round(rect);
-- or --
rectF.roundOut(rect);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With