MapUtilities.java 文件源码

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

项目:litiengine 作者:
public static Path2D convertPolylineToPath(final IMapObject mapObject) {
  if (mapObject == null || mapObject.getPolyline() == null || mapObject.getPolyline().getPoints().isEmpty()) {
    return null;
  }

  Path2D path = new Path2D.Float();
  path.moveTo(mapObject.getLocation().getX(), mapObject.getLocation().getY());
  for (int i = 1; i < mapObject.getPolyline().getPoints().size(); i++) {
    Point2D point = mapObject.getPolyline().getPoints().get(i);
    path.lineTo(mapObject.getLocation().getX() + point.getX(), mapObject.getLocation().getY() + point.getY());
  }

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


问题


面经


文章

微信
公众号

扫码关注公众号