use of net.sf.latexdraw.model.api.shape.Ellipse in project latexdraw by arnobl.
the class TestParsingPsellipse method testParse2CoordinatesFloatSigns2.
@Test
public void testParse2CoordinatesFloatSigns2() {
parser("\\psellipse(-+.5,+-5)(+++35.5,--50.5)");
final Ellipse ell = getShapeAt(0);
assertEquals(-.5 * Shape.PPC - 35.5 * Shape.PPC, ell.getPosition().getX(), 0.001);
assertEquals(-5d * -Shape.PPC + 50.5 * Shape.PPC, ell.getPosition().getY(), 0.001);
assertEquals(35.5 * Shape.PPC * 2d, ell.getWidth(), 0.001);
assertEquals(50.5 * Shape.PPC * 2d, ell.getHeight(), 0.001);
}
use of net.sf.latexdraw.model.api.shape.Ellipse in project latexdraw by arnobl.
the class TestParsingPsellipse method testParse2WidthHeight0.
@Test
public void testParse2WidthHeight0() {
parser("\\psellipse(0,0)(0,0)");
final Ellipse ell = getShapeAt(0);
assertTrue(ell.getWidth() > 0);
assertTrue(ell.getHeight() > 0);
}
use of net.sf.latexdraw.model.api.shape.Ellipse in project latexdraw by arnobl.
the class TestParsingPsellipse method testParse2CoordinatesFloat2.
@Test
public void testParse2CoordinatesFloat2() {
parser("\\psellipse(.5,.5)(35.5,50.5)");
final Ellipse ell = getShapeAt(0);
assertEquals(.5 * Shape.PPC - 35.5 * Shape.PPC, ell.getPosition().getX(), 0.001);
assertEquals(.5 * -Shape.PPC + 50.5 * Shape.PPC, ell.getPosition().getY(), 0.001);
assertEquals(35.5 * Shape.PPC * 2d, ell.getWidth(), 0.001);
assertEquals(50.5 * Shape.PPC * 2d, ell.getHeight(), 0.001);
}
use of net.sf.latexdraw.model.api.shape.Ellipse in project latexdraw by arnobl.
the class TestParsingPsellipse method testParse2CoordinatesFloat.
@Test
public void testParse2CoordinatesFloat() {
parser("\\psellipse(10.5,20.5)(35.5,50.5)");
final Ellipse ell = getShapeAt(0);
assertEquals(10.5 * Shape.PPC - 35.5 * Shape.PPC, ell.getPosition().getX(), 0.001);
assertEquals(20.5 * -Shape.PPC + 50.5 * Shape.PPC, ell.getPosition().getY(), 0.001);
assertEquals(35.5 * Shape.PPC * 2d, ell.getWidth(), 0.001);
assertEquals(50.5 * Shape.PPC * 2d, ell.getHeight(), 0.001);
}
use of net.sf.latexdraw.model.api.shape.Ellipse in project latexdraw by arnobl.
the class TestParsingPsellipse method testCoordinatesCm.
@Test
public void testCoordinatesCm() {
parser("\\psellipse(0,0)(35cm,20cm)");
final Ellipse ell = getShapeAt(0);
assertEquals(-35d * Shape.PPC, ell.getPosition().getX(), 0.001);
assertEquals(-20d * Shape.PPC * -1d, ell.getPosition().getY(), 0.001);
assertEquals(35d * Shape.PPC * 2d, ell.getWidth(), 0.001);
assertEquals(20d * Shape.PPC * 2d, ell.getHeight(), 0.001);
}
Aggregations