110,538
社区成员
发帖
与我相关
我的任务
分享
public static float getYCoordinate(Rect rect,float yValue,float max,float min)
{
float x = 0;
float h = rect.height();
x = rect.top+h*(max - yValue)/(max - min);
return x;
}
public static float getYValue(Rect rect,float y,float max,float min)
{
float x = 0;
float h = rect.height();
x = max-(max-min)*(y-rect.top)/h;
return x;
}