• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java EdgePair类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.edmodo.cropper.cropwindow.edge.EdgePair的典型用法代码示例。如果您正苦于以下问题:Java EdgePair类的具体用法?Java EdgePair怎么用?Java EdgePair使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



EdgePair类属于com.edmodo.cropper.cropwindow.edge包,在下文中一共展示了EdgePair类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: updateCropWindow

import com.edmodo.cropper.cropwindow.edge.EdgePair; //导入依赖的package包/类
/**
 * Updates the crop window by directly setting the Edge coordinates.
 *
 * @param x          the new x-coordinate of this handle
 * @param y          the new y-coordinate of this handle
 * @param imageRect  the bounding rectangle of the image
 * @param parentView the parent View containing the image
 * @param snapRadius the maximum distance (in pixels) at which the crop
 *                   window should snap to the image
 */
void updateCropWindow(float x,
                      float y,
                      Rect imageRect,
                      float snapRadius) {

    final EdgePair activeEdges = getActiveEdges();
    final Edge primaryEdge = activeEdges.primary;
    final Edge secondaryEdge = activeEdges.secondary;

    if (primaryEdge != null)
        primaryEdge.adjustCoordinate(x, y, imageRect, snapRadius, UNFIXED_ASPECT_RATIO_CONSTANT);

    if (secondaryEdge != null)
        secondaryEdge.adjustCoordinate(x, y, imageRect, snapRadius, UNFIXED_ASPECT_RATIO_CONSTANT);
}
 
开发者ID:g82,项目名称:open-mygirl-android-gradle,代码行数:26,代码来源:HandleHelper.java


示例2: getActiveEdges

import com.edmodo.cropper.cropwindow.edge.EdgePair; //导入依赖的package包/类
/**
 * Gets the Edges associated with this handle as an ordered Pair. The
 * <code>primary</code> Edge in the pair is the determining side. This
 * method is used when we need to maintain the aspect ratio.
 *
 * @param x                 the x-coordinate of the touch point
 * @param y                 the y-coordinate of the touch point
 * @param targetAspectRatio the aspect ratio that we are maintaining
 * @return the active edges as an ordered pair
 */
EdgePair getActiveEdges(float x, float y, float targetAspectRatio) {

    // Calculate the aspect ratio if this handle were dragged to the given
    // x-y coordinate.
    final float potentialAspectRatio = getAspectRatio(x, y);

    // If the touched point is wider than the aspect ratio, then x
    // is the determining side. Else, y is the determining side.
    if (potentialAspectRatio > targetAspectRatio) {
        mActiveEdges.primary = mVerticalEdge;
        mActiveEdges.secondary = mHorizontalEdge;
    } else {
        mActiveEdges.primary = mHorizontalEdge;
        mActiveEdges.secondary = mVerticalEdge;
    }
    return mActiveEdges;
}
 
开发者ID:g82,项目名称:open-mygirl-android-gradle,代码行数:28,代码来源:HandleHelper.java


示例3: updateCropWindow

import com.edmodo.cropper.cropwindow.edge.EdgePair; //导入依赖的package包/类
@Override
void updateCropWindow(float x,
                      float y,
                      float targetAspectRatio,
                      Rect imageRect,
                      float snapRadius) {

    final EdgePair activeEdges = getActiveEdges(x, y, targetAspectRatio);
    final Edge primaryEdge = activeEdges.primary;
    final Edge secondaryEdge = activeEdges.secondary;

    primaryEdge.adjustCoordinate(x, y, imageRect, snapRadius, targetAspectRatio);
    secondaryEdge.adjustCoordinate(targetAspectRatio);

    if (secondaryEdge.isOutsideMargin(imageRect, snapRadius)) {
        secondaryEdge.snapToRect(imageRect);
        primaryEdge.adjustCoordinate(targetAspectRatio);
    }
}
 
开发者ID:g82,项目名称:open-mygirl-android-gradle,代码行数:20,代码来源:CornerHandleHelper.java


示例4: updateCropWindow

import com.edmodo.cropper.cropwindow.edge.EdgePair; //导入依赖的package包/类
/**
 * Updates the crop window by directly setting the Edge coordinates.
 * 
 * @param x the new x-coordinate of this handle
 * @param y the new y-coordinate of this handle
 * @param imageRect the bounding rectangle of the image
 * @param parentView the parent View containing the image
 * @param snapRadius the maximum distance (in pixels) at which the crop
 *            window should snap to the image
 */
void updateCropWindow(float x,
                      float y,
                      Rect imageRect,
                      float snapRadius) {

    final EdgePair activeEdges = getActiveEdges();
    final Edge primaryEdge = activeEdges.primary;
    final Edge secondaryEdge = activeEdges.secondary;

    if (primaryEdge != null)
        primaryEdge.adjustCoordinate(x, y, imageRect, snapRadius, UNFIXED_ASPECT_RATIO_CONSTANT);

    if (secondaryEdge != null)
        secondaryEdge.adjustCoordinate(x, y, imageRect, snapRadius, UNFIXED_ASPECT_RATIO_CONSTANT);
}
 
开发者ID:wangeason,项目名称:PhotoViewCropper,代码行数:26,代码来源:HandleHelper.java


示例5: getActiveEdges

import com.edmodo.cropper.cropwindow.edge.EdgePair; //导入依赖的package包/类
/**
 * Gets the Edges associated with this handle as an ordered Pair. The
 * <code>primary</code> Edge in the pair is the determining side. This
 * method is used when we need to maintain the aspect ratio.
 * 
 * @param x the x-coordinate of the touch point
 * @param y the y-coordinate of the touch point
 * @param targetAspectRatio the aspect ratio that we are maintaining
 * @return the active edges as an ordered pair
 */
EdgePair getActiveEdges(float x, float y, float targetAspectRatio) {

    // Calculate the aspect ratio if this handle were dragged to the given
    // x-y coordinate.
    final float potentialAspectRatio = getAspectRatio(x, y);

    // If the touched point is wider than the aspect ratio, then x
    // is the determining side. Else, y is the determining side.
    if (potentialAspectRatio > targetAspectRatio) {
        mActiveEdges.primary = mVerticalEdge;
        mActiveEdges.secondary = mHorizontalEdge;
    } else {
        mActiveEdges.primary = mHorizontalEdge;
        mActiveEdges.secondary = mVerticalEdge;
    }
    return mActiveEdges;
}
 
开发者ID:wangeason,项目名称:PhotoViewCropper,代码行数:28,代码来源:HandleHelper.java


示例6: updateCropWindow

import com.edmodo.cropper.cropwindow.edge.EdgePair; //导入依赖的package包/类
/**
 * Updates the crop window by directly setting the Edge coordinates.
 *
 * @param x          the new x-coordinate of this handle
 * @param y          the new y-coordinate of this handle
 * @param imageRect  the bounding rectangle of the image
 * @param snapRadius the maximum distance (in pixels) at which the crop window should snap to
 *                   the image
 */
void updateCropWindow(float x,
                      float y,
                      @NonNull RectF imageRect,
                      float snapRadius) {

    final EdgePair activeEdges = getActiveEdges();
    final Edge primaryEdge = activeEdges.primary;
    final Edge secondaryEdge = activeEdges.secondary;

    if (primaryEdge != null)
        primaryEdge.adjustCoordinate(x, y, imageRect, snapRadius, UNFIXED_ASPECT_RATIO_CONSTANT);

    if (secondaryEdge != null)
        secondaryEdge.adjustCoordinate(x, y, imageRect, snapRadius, UNFIXED_ASPECT_RATIO_CONSTANT);
}
 
开发者ID:edmodo,项目名称:cropper,代码行数:25,代码来源:HandleHelper.java


示例7: getActiveEdges

import com.edmodo.cropper.cropwindow.edge.EdgePair; //导入依赖的package包/类
/**
 * Gets the Edges associated with this handle as an ordered Pair. The <code>primary</code> Edge
 * in the pair is the determining side. This method is used when we need to maintain the aspect
 * ratio.
 *
 * @param x                 the x-coordinate of the touch point
 * @param y                 the y-coordinate of the touch point
 * @param targetAspectRatio the aspect ratio that we are maintaining
 *
 * @return the active edges as an ordered pair
 */
EdgePair getActiveEdges(float x, float y, float targetAspectRatio) {

    // Calculate the aspect ratio if this handle were dragged to the given x-y coordinate.
    final float potentialAspectRatio = getAspectRatio(x, y);

    // If the touched point is wider than the aspect ratio, then x is the determining side. Else, y is the determining side.
    if (potentialAspectRatio > targetAspectRatio) {
        mActiveEdges.primary = mVerticalEdge;
        mActiveEdges.secondary = mHorizontalEdge;
    } else {
        mActiveEdges.primary = mHorizontalEdge;
        mActiveEdges.secondary = mVerticalEdge;
    }
    return mActiveEdges;
}
 
开发者ID:edmodo,项目名称:cropper,代码行数:27,代码来源:HandleHelper.java


示例8: updateCropWindow

import com.edmodo.cropper.cropwindow.edge.EdgePair; //导入依赖的package包/类
@Override
void updateCropWindow(float x,
                      float y,
                      float targetAspectRatio,
                      @NonNull RectF imageRect,
                      float snapRadius) {

    final EdgePair activeEdges = getActiveEdges(x, y, targetAspectRatio);
    final Edge primaryEdge = activeEdges.primary;
    final Edge secondaryEdge = activeEdges.secondary;

    primaryEdge.adjustCoordinate(x, y, imageRect, snapRadius, targetAspectRatio);
    secondaryEdge.adjustCoordinate(targetAspectRatio);

    if (secondaryEdge.isOutsideMargin(imageRect, snapRadius)) {
        secondaryEdge.snapToRect(imageRect);
        primaryEdge.adjustCoordinate(targetAspectRatio);
    }
}
 
开发者ID:edmodo,项目名称:cropper,代码行数:20,代码来源:CornerHandleHelper.java


示例9: a

import com.edmodo.cropper.cropwindow.edge.EdgePair; //导入依赖的package包/类
void a(float f, float f1, float f2, Rect rect, float f3)
{
    EdgePair edgepair = a(f, f1, f2);
    Edge edge = edgepair.primary;
    Edge edge1 = edgepair.secondary;
    edge.adjustCoordinate(f, f1, rect, f3, f2);
    edge1.adjustCoordinate(f2);
    if (edge1.isOutsideMargin(rect, f3))
    {
        edge1.snapToRect(rect);
        edge.adjustCoordinate(f2);
    }
}
 
开发者ID:vishnudevk,项目名称:MiBandDecompiled,代码行数:14,代码来源:b.java


示例10: a

import com.edmodo.cropper.cropwindow.edge.EdgePair; //导入依赖的package包/类
EdgePair a(float f, float f1, float f2)
{
    if (a(f, f1) > f2)
    {
        d.primary = c;
        d.secondary = b;
    } else
    {
        d.primary = b;
        d.secondary = c;
    }
    return d;
}
 
开发者ID:vishnudevk,项目名称:MiBandDecompiled,代码行数:14,代码来源:c.java


示例11: c

import com.edmodo.cropper.cropwindow.edge.EdgePair; //导入依赖的package包/类
c(Edge edge, Edge edge1)
{
    b = edge;
    c = edge1;
    d = new EdgePair(b, c);
}
 
开发者ID:vishnudevk,项目名称:MiBandDecompiled,代码行数:7,代码来源:c.java


示例12: HandleHelper

import com.edmodo.cropper.cropwindow.edge.EdgePair; //导入依赖的package包/类
/**
 * Constructor.
 *
 * @param horizontalEdge the horizontal edge associated with this handle;
 *                       may be null
 * @param verticalEdge   the vertical edge associated with this handle; may be
 *                       null
 */
HandleHelper(Edge horizontalEdge, Edge verticalEdge) {
    mHorizontalEdge = horizontalEdge;
    mVerticalEdge = verticalEdge;
    mActiveEdges = new EdgePair(mHorizontalEdge, mVerticalEdge);
}
 
开发者ID:g82,项目名称:open-mygirl-android-gradle,代码行数:14,代码来源:HandleHelper.java


示例13: HandleHelper

import com.edmodo.cropper.cropwindow.edge.EdgePair; //导入依赖的package包/类
/**
 * Constructor.
 * 
 * @param horizontalEdge the horizontal edge associated with this handle;
 *            may be null
 * @param verticalEdge the vertical edge associated with this handle; may be
 *            null
 */
HandleHelper(Edge horizontalEdge, Edge verticalEdge) {
    mHorizontalEdge = horizontalEdge;
    mVerticalEdge = verticalEdge;
    mActiveEdges = new EdgePair(mHorizontalEdge, mVerticalEdge);
}
 
开发者ID:wangeason,项目名称:PhotoViewCropper,代码行数:14,代码来源:HandleHelper.java


示例14: HandleHelper

import com.edmodo.cropper.cropwindow.edge.EdgePair; //导入依赖的package包/类
/**
 * Constructor.
 *
 * @param horizontalEdge the horizontal edge associated with this handle; may be null
 * @param verticalEdge   the vertical edge associated with this handle; may be null
 */
HandleHelper(Edge horizontalEdge, Edge verticalEdge) {
    mHorizontalEdge = horizontalEdge;
    mVerticalEdge = verticalEdge;
    mActiveEdges = new EdgePair(mHorizontalEdge, mVerticalEdge);
}
 
开发者ID:edmodo,项目名称:cropper,代码行数:12,代码来源:HandleHelper.java



注:本文中的com.edmodo.cropper.cropwindow.edge.EdgePair类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java BaseRobotRules类代码示例发布时间:2022-05-23
下一篇:
Java SocketStatus类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap