use of net.sf.latexdraw.models.interfaces.shape.IEllipse in project latexdraw by arnobl.
the class TestParsingPsellipse method testCoordinatesMm.
@Test
public void testCoordinatesMm() {
parser("\\psellipse(0,0)(350mm,200mm)");
IEllipse ell = getShapeAt(0);
assertEquals(-35d * IShape.PPC, ell.getPosition().getX(), 0.001);
assertEquals(-20d * IShape.PPC * -1d, ell.getPosition().getY(), 0.001);
assertEquals(35d * IShape.PPC * 2d, ell.getWidth(), 0.001);
assertEquals(20d * IShape.PPC * 2d, ell.getHeight(), 0.001);
}
use of net.sf.latexdraw.models.interfaces.shape.IEllipse in project latexdraw by arnobl.
the class TestParsingPsellipse method testParse2WidthHeight0.
@Test
public void testParse2WidthHeight0() {
parser("\\psellipse(0,0)(0,0)");
IEllipse ell = getShapeAt(0);
assertTrue(ell.getWidth() > 0);
assertTrue(ell.getHeight() > 0);
}
use of net.sf.latexdraw.models.interfaces.shape.IEllipse in project latexdraw by arnobl.
the class TestParsingPsellipse method testCoordinatesInch.
@Test
public void testCoordinatesInch() {
parser("\\psellipse(0,0)(35in,20in)");
IEllipse ell = getShapeAt(0);
assertEquals(-35d * IShape.PPC / 2.54, ell.getPosition().getX(), 0.001);
assertEquals(-20d * IShape.PPC / 2.54 * -1d, ell.getPosition().getY(), 0.001);
assertEquals(35d * IShape.PPC / 2.54 * 2d, ell.getWidth(), 0.001);
assertEquals(20d * IShape.PPC / 2.54 * 2d, ell.getHeight(), 0.001);
}
use of net.sf.latexdraw.models.interfaces.shape.IEllipse in project latexdraw by arnobl.
the class TestParsingPsellipse method testParse2CoordinatesFloatSigns2.
@Test
public void testParse2CoordinatesFloatSigns2() {
parser("\\psellipse(-+.5,+-5)(+++35.5,--50.5)");
IEllipse ell = getShapeAt(0);
assertEquals(-.5 * IShape.PPC - 35.5 * IShape.PPC, ell.getPosition().getX(), 0.001);
assertEquals(-5d * -IShape.PPC + 50.5 * IShape.PPC, ell.getPosition().getY(), 0.001);
assertEquals(35.5 * IShape.PPC * 2d, ell.getWidth(), 0.001);
assertEquals(50.5 * IShape.PPC * 2d, ell.getHeight(), 0.001);
}
use of net.sf.latexdraw.models.interfaces.shape.IEllipse in project latexdraw by arnobl.
the class TestParsingPsellipse method testParse2CoordinatesFloat2.
@Test
public void testParse2CoordinatesFloat2() {
parser("\\psellipse(.5,.5)(35.5,50.5)");
IEllipse ell = getShapeAt(0);
assertEquals(.5 * IShape.PPC - 35.5 * IShape.PPC, ell.getPosition().getX(), 0.001);
assertEquals(.5 * -IShape.PPC + 50.5 * IShape.PPC, ell.getPosition().getY(), 0.001);
assertEquals(35.5 * IShape.PPC * 2d, ell.getWidth(), 0.001);
assertEquals(50.5 * IShape.PPC * 2d, ell.getHeight(), 0.001);
}
Aggregations