Search in sources :

Example 21 with Polyline

use of net.sf.latexdraw.model.api.shape.Polyline in project latexdraw by arnobl.

the class TestParsingPsline method testCoordinatesMm.

@Test
public void testCoordinatesMm() {
    parser("\\psline(350mm,200mm)(10mm, 30.3mm)");
    final Polyline line = (Polyline) parsedShapes.get(0);
    assertEquals(2, line.getNbPoints());
    assertEquals(35d * Shape.PPC, line.getPtAt(0).getX(), 0.0001);
    assertEquals(-20d * Shape.PPC, line.getPtAt(0).getY(), 0.0001);
    assertEquals(1d * Shape.PPC, line.getPtAt(1).getX(), 0.0001);
    assertEquals(-3.03 * Shape.PPC, line.getPtAt(1).getY(), 0.0001);
}
Also used : Polyline(net.sf.latexdraw.model.api.shape.Polyline) Test(org.junit.jupiter.api.Test)

Aggregations

Polyline (net.sf.latexdraw.model.api.shape.Polyline)21 Test (org.junit.jupiter.api.Test)14 Point (net.sf.latexdraw.model.api.shape.Point)3 Polygon (net.sf.latexdraw.model.api.shape.Polygon)3 Test (org.junit.Test)3 HelperTest (net.sf.latexdraw.HelperTest)2 BezierCurve (net.sf.latexdraw.model.api.shape.BezierCurve)2 Circle (net.sf.latexdraw.model.api.shape.Circle)2 Freehand (net.sf.latexdraw.model.api.shape.Freehand)2 ModifiablePointsShape (net.sf.latexdraw.model.api.shape.ModifiablePointsShape)2 Rectangle (net.sf.latexdraw.model.api.shape.Rectangle)2 Shape (net.sf.latexdraw.model.api.shape.Shape)2 NotNull (org.jetbrains.annotations.NotNull)2 Click (io.github.interacto.jfx.interaction.library.Click)1 DnD (io.github.interacto.jfx.interaction.library.DnD)1 MultiClick (io.github.interacto.jfx.interaction.library.MultiClick)1 PointsData (io.github.interacto.jfx.interaction.library.PointsData)1 Press (io.github.interacto.jfx.interaction.library.Press)1 ArrayList (java.util.ArrayList)1 Arrays (java.util.Arrays)1