Rect and RectF in Android SDK

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

  • equals(Object obj) (for some reason it has its own implementation of equals)
  • exactCenterX()
  • exactCenterY()
  • flattenToString()
  • toShortString()
  • unflattenFromString(String str)

RectF

  • round(Rect dst)
  • roundOut(Rect dst)
  • set(Rect src)

So apparently there are some differences.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)