Iulius Curt
Iulius Curt

Reputation: 5114

Rect and RectF in Android SDK

What is the difference between Rect and RectF in the Android SDK?

Upvotes: 60

Views: 22434

Answers (2)

JayJay
JayJay

Reputation: 592

Rect is final, RectF can be extended

Upvotes: 17

Octavian Helm
Octavian Helm

Reputation: 39605

Using Rect you define its edges using integers and using RectF they are defined as floats.

Looking at them more carefully I have spotted a few differences actually. I will only list what one implementation has more compared to the other one.

Rect

RectF

So apparently there are some differences.

Upvotes: 57

Related Questions