Skip to content

Instantly share code, notes, and snippets.

@matux
Created October 30, 2013 21:24
Show Gist options
  • Save matux/7240542 to your computer and use it in GitHub Desktop.
Save matux/7240542 to your computer and use it in GitHub Desktop.
- final float wd = w - d.getIntrinsicWidth();
- final float wdDiv2 = wd / 2;
+ final float wd = (getWidth() / 2) - (w / 2);
final RectF r1 = new RectF(0, offset, d.getIntrinsicWidth(), d.getIntrinsicHeight());
- final RectF r2 = new RectF(-wdDiv2, 0, d.getIntrinsicWidth() + wdDiv2, getHeight());
+ final RectF r2 = new RectF(wd, 0, getWidth() - wd, getHeight());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment