SpotImagePanel.java 文件源码

java
阅读 14 收藏 0 点赞 0 评论 0

项目:orbit-image-analysis 作者:
protected SpotPos detectSpot(double x, double y) {
    Arc2D.Double arc;
    x -= iOffsX;
    y -= iOffsY;
    x /= scale;
    y /= scale;
    Point p;

    if (SpotImagePanel.this.spotPosList != null && SpotImagePanel.this.spotPosList.size() > 0) {
        for (SpotPos sp : SpotImagePanel.this.spotPosList) {
            p = sp.getPos();
            arc = new Arc2D.Double(p.x - SpotImagePanel.this.radius, p.y - SpotImagePanel.this.radius, SpotImagePanel.this.radius * 2, SpotImagePanel.this.radius * 2, 0, 360, Arc2D.CHORD);
            if (arc.contains(new Point((int) x, (int) y))) {
                return sp;
            }

        }
    }
    return null;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号