use of net.sf.latexdraw.models.interfaces.shape.ICircle in project latexdraw by arnobl.
the class TestParsingQdisk method testCoordinatesCm.
@Test
public void testCoordinatesCm() {
parser("\\qdisk(35cm,20cm){.5cm}");
ICircle cir = getShapeAt(0);
assertEquals(35d * IShape.PPC - 0.5 * IShape.PPC, cir.getPosition().getX(), 0.001);
assertEquals((20d * IShape.PPC - 0.5 * IShape.PPC) * -1d, cir.getPosition().getY(), 0.001);
assertEquals(0.5 * IShape.PPC * 2d, cir.getWidth(), 0.0000001);
assertEquals(0.5 * IShape.PPC * 2d, cir.getHeight(), 0.0000001);
}
use of net.sf.latexdraw.models.interfaces.shape.ICircle in project latexdraw by arnobl.
the class TestParsingPscircle method testUnit.
@Test
public void testUnit() {
parser("\\psset{unit=4}\\pscircle(2,3cm){5}");
ICircle cir = getShapeAt(0);
assertEquals(4d * 2d * IShape.PPC - 5d * IShape.PPC, cir.getX(), 0.0001);
assertEquals(-3d * IShape.PPC + 5d * IShape.PPC, cir.getY(), 0.0001);
assertEquals(2d * 5d * IShape.PPC, cir.getWidth(), 0.0001);
}
use of net.sf.latexdraw.models.interfaces.shape.ICircle in project latexdraw by arnobl.
the class TestParsingPscircle method testNegativeRadius.
@Test
public void testNegativeRadius() {
parser("\\pscircle(0,0){-1}");
ICircle cir = getShapeAt(0);
assertThat(cir.getWidth(), greaterThan(0d));
assertThat(cir.getHeight(), greaterThan(0d));
}
Aggregations