Search in sources :

Example 21 with Circle

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

the class TestParsingPscircle method testParse2CoordinatesFloat2.

@Test
public void testParse2CoordinatesFloat2() {
    parser("\\pscircle(35.5,50.5){1.25}");
    final Circle cir = getShapeAt(0);
    assertEquals(35.5 * Shape.PPC - 1.25 * Shape.PPC, cir.getPosition().getX(), 0.001);
    assertEquals((50.5 * Shape.PPC - 1.25 * Shape.PPC) * -1d, cir.getPosition().getY(), 0.001);
    assertEquals(1.25 * Shape.PPC * 2d, cir.getWidth(), 0.0000001);
    assertEquals(1.25 * Shape.PPC * 2d, cir.getHeight(), 0.0000001);
}
Also used : Circle(net.sf.latexdraw.model.api.shape.Circle) Test(org.junit.jupiter.api.Test)

Aggregations

Circle (net.sf.latexdraw.model.api.shape.Circle)21 Test (org.junit.jupiter.api.Test)17 Test (org.junit.Test)3 HelperTest (net.sf.latexdraw.HelperTest)2 Point2D (javafx.geometry.Point2D)1 Axes (net.sf.latexdraw.model.api.shape.Axes)1 BezierCurve (net.sf.latexdraw.model.api.shape.BezierCurve)1 CircleArc (net.sf.latexdraw.model.api.shape.CircleArc)1 Dot (net.sf.latexdraw.model.api.shape.Dot)1 Ellipse (net.sf.latexdraw.model.api.shape.Ellipse)1 Freehand (net.sf.latexdraw.model.api.shape.Freehand)1 Grid (net.sf.latexdraw.model.api.shape.Grid)1 Plot (net.sf.latexdraw.model.api.shape.Plot)1 Polygon (net.sf.latexdraw.model.api.shape.Polygon)1 Polyline (net.sf.latexdraw.model.api.shape.Polyline)1 Rectangle (net.sf.latexdraw.model.api.shape.Rectangle)1 Rhombus (net.sf.latexdraw.model.api.shape.Rhombus)1 Square (net.sf.latexdraw.model.api.shape.Square)1 Text (net.sf.latexdraw.model.api.shape.Text)1 Triangle (net.sf.latexdraw.model.api.shape.Triangle)1