我试图以2d(x,y)的角度对齐气泡,但是" y"我做得不对。
我的观察测量结果(最大值和最小值)Burbua定位不正确,无法找到错误:
" x"让我所有的决议(你可以检查填充或边距)
我想要什么
http://i.imgur.com/QfZbaxX.png
我得到了什么:
http://i.imgur.com/gNXMZy2.png
X(正确)
bubble1D_x.setBounds(
(int) (x - halfBubbleWidth) ,
(int) minBubble-levelHeight ,
(int) (x + halfBubbleWidth) ,
(int) maxBubble-levelHeight ) ;
中(正确)
bubble2D.setBounds(
(int) x - halfBubbleWidth ,
(int) y - halfBubbleHeight ,
(int) x + halfBubbleWidth ,
(int) y + halfBubbleHeight );
Y(错)
bubble1D_y.setBounds(
(int) minBubble-levelHeight ,
(int) y - halfBubbleWidth ,
(int) maxBubble-levelHeight ,
(int) y + halfBubbleWidth
);
这里是原始代码:here