More than level of parent for padding calculation

This commit is contained in:
dvhh 2015-04-13 23:36:25 +09:00
parent 112029cc15
commit f41e95eac6

View File

@ -1498,9 +1498,10 @@ public class EmulatorView extends View implements GestureDetector.OnGestureListe
int w = getWidth() - getPaddingLeft() -getPaddingRight();
int h = getHeight() -getPaddingTop() -getPaddingBottom();
ViewParent parent=getParent();
if(parent instanceof View) {
while(parent instanceof View) {
w -= ((View) parent).getPaddingLeft() + ((View) parent).getPaddingRight();
h -= ((View) parent).getPaddingTop() + ((View) parent).getPaddingBottom();
parent = ((View)parent).getParent();
}
//Log.w("Term", "(" + w + ", " + h + ")");