本文整理汇总了Java中com.edmodo.cropper.cropwindow.edge.Edge.TOP属性的典型用法代码示例。如果您正苦于以下问题:Java Edge.TOP属性的具体用法?Java Edge.TOP怎么用?Java Edge.TOP使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.edmodo.cropper.cropwindow.edge.Edge
的用法示例。
在下文中一共展示了Edge.TOP属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getAspectRatio
/**
* Gets the aspect ratio of the resulting crop window if this handle were
* dragged to the given point.
*
* @param x the x-coordinate
* @param y the y-coordinate
* @return the aspect ratio
*/
private float getAspectRatio(float x, float y) {
// Replace the active edge coordinate with the given touch coordinate.
final float left = (mVerticalEdge == Edge.LEFT) ? x : Edge.LEFT.getCoordinate();
final float top = (mHorizontalEdge == Edge.TOP) ? y : Edge.TOP.getCoordinate();
final float right = (mVerticalEdge == Edge.RIGHT) ? x : Edge.RIGHT.getCoordinate();
final float bottom = (mHorizontalEdge == Edge.BOTTOM) ? y : Edge.BOTTOM.getCoordinate();
final float aspectRatio = AspectRatioUtil.calculateAspectRatio(left, top, right, bottom);
return aspectRatio;
}
示例2: getAspectRatio
/**
* Gets the aspect ratio of the resulting crop window if this handle were
* dragged to the given point.
*
* @param x the x-coordinate
* @param y the y-coordinate
* @return the aspect ratio
*/
private float getAspectRatio(float x, float y) {
// Replace the active edge coordinate with the given touch coordinate.
final float left = (mVerticalEdge == Edge.LEFT) ? x : Edge.LEFT.getCoordinate();
final float top = (mHorizontalEdge == Edge.TOP) ? y : Edge.TOP.getCoordinate();
final float right = (mVerticalEdge == Edge.RIGHT) ? x : Edge.RIGHT.getCoordinate();
final float bottom = (mHorizontalEdge == Edge.BOTTOM) ? y : Edge.BOTTOM.getCoordinate();
final float aspectRatio = AspectRatioUtil.calculateAspectRatio(left, top, right, bottom);
return aspectRatio;
}
示例3: a
private float a(float f, float f1)
{
float f2;
float f3;
if (c == Edge.LEFT)
{
f2 = f;
} else
{
f2 = Edge.LEFT.getCoordinate();
}
if (b == Edge.TOP)
{
f3 = f1;
} else
{
f3 = Edge.TOP.getCoordinate();
}
if (c != Edge.RIGHT)
{
f = Edge.RIGHT.getCoordinate();
}
if (b != Edge.BOTTOM)
{
f1 = Edge.BOTTOM.getCoordinate();
}
return AspectRatioUtil.calculateAspectRatio(f2, f3, f, f1);
}
示例4: getAspectRatio
/**
* Gets the aspect ratio of the resulting crop window if this handle were dragged to the given
* point.
*
* @param x the x-coordinate
* @param y the y-coordinate
*
* @return the aspect ratio
*/
private float getAspectRatio(float x, float y) {
// Replace the active edge coordinate with the given touch coordinate.
final float left = (mVerticalEdge == Edge.LEFT) ? x : Edge.LEFT.getCoordinate();
final float top = (mHorizontalEdge == Edge.TOP) ? y : Edge.TOP.getCoordinate();
final float right = (mVerticalEdge == Edge.RIGHT) ? x : Edge.RIGHT.getCoordinate();
final float bottom = (mHorizontalEdge == Edge.BOTTOM) ? y : Edge.BOTTOM.getCoordinate();
return AspectRatioUtil.calculateAspectRatio(left, top, right, bottom);
}