コード例 #1
0
ファイル: DrawVector.java プロジェクト: hulstores/geogebra
  /** Returns the bounding box of this Drawable in screen coordinates. */
  @Override
  public final org.geogebra.common.awt.GRectangle getBounds() {
    if (!geo.isDefined() || !geo.isEuclidianVisible()) return null;
    org.geogebra.common.awt.GRectangle ret = null;
    if (lineVisible) ret = line.getBounds();

    if (arrowheadVisible)
      ret =
          (ret == null)
              ? AwtFactory.prototype.newRectangle(gp.getBounds())
              : AwtFactory.prototype.newRectangle(ret.union(gp.getBounds()));

    return ret;
  }
コード例 #2
0
ファイル: DrawVector.java プロジェクト: hulstores/geogebra
 @Override
 public final boolean isInside(org.geogebra.common.awt.GRectangle rect) {
   return (lineVisible && rect.contains(line.getBounds()))
       || (arrowheadVisible && rect.contains(gp.getBounds()));
 }