Whats the best way to convert a Rect variable to a RectF one? I am unable to cast it.
RectF rect = (RectF) currentRect; //produces an error
Whats the best way to convert a Rect variable to a RectF one? I am unable to cast it.
RectF rect = (RectF) currentRect; //produces an error
As "new" shouldn't be done in onDraw,
// As class fields,
Rect rect = new Rect();
RectF rectF = new RectF();
...
onDraw(Canvas canvas) {
...
rectF.set(rect);
...
}