Example usage for com.itextpdf.awt.geom Point2D distance

List of usage examples for com.itextpdf.awt.geom Point2D distance

Introduction

In this page you can find the example usage for com.itextpdf.awt.geom Point2D distance.

Prototype

public double distance(Point2D p) 

Source Link

Usage

From source file:mkl.testarea.itext5.pdfcleanup.PdfCleanUpRegionFilter.java

License:Open Source License

private static float applyDash(Path dashedPath, Point2D segStart, Point2D segEnd, Point2D dashTo,
        boolean isGap) {
    float remainingDist = 0;

    if (!liesOnSegment(segStart, segEnd, dashTo)) {
        remainingDist = (float) dashTo.distance(segEnd);
        dashTo = segEnd;/*from  ww w . java2 s  . c o m*/
    }

    if (isGap) {
        dashedPath.moveTo((float) dashTo.getX(), (float) dashTo.getY());
    } else {
        dashedPath.lineTo((float) dashTo.getX(), (float) dashTo.getY());
    }

    return remainingDist;
}