use of net.sf.latexdraw.models.interfaces.shape.IRectangle in project latexdraw by arnobl.
the class TestParsingPsframe method testPssetunit.
@Test
public void testPssetunit() {
parser("\\psset{unit=2}\\psframe(1,1)(5,5)");
final IRectangle rec = getShapeAt(0);
assertEquals(2d * IShape.PPC, rec.getX(), 0.000001);
assertEquals(-2d * IShape.PPC, rec.getY(), 0.000001);
assertEquals(2d * 4d * IShape.PPC, rec.getWidth(), 0.000001);
assertEquals(2d * 4d * IShape.PPC, rec.getHeight(), 0.000001);
}
use of net.sf.latexdraw.models.interfaces.shape.IRectangle in project latexdraw by arnobl.
the class TestParsingPsframe method testParamFramearcKO.
@Theory
public void testParamFramearcKO(@DoubleData(vals = { -1d, 2 }) final double arc) {
parser("\\psframe[framearc=" + arc + "](35,20)");
final IRectangle rec = getShapeAt(0);
assertEquals(0d, rec.getLineArc(), 0.00001);
}
use of net.sf.latexdraw.models.interfaces.shape.IRectangle in project latexdraw by arnobl.
the class TestParsingPsframe method testParse2CoordinatesTwoFirstMissing.
@Test
public void testParse2CoordinatesTwoFirstMissing() {
parser("\\psframe(,)(35,50)");
final IRectangle rec = getShapeAt(0);
assertEquals(IShape.PPC, rec.getPosition().getX(), 0.001);
assertEquals(-IShape.PPC, rec.getPosition().getY(), 0.001);
assertEquals(34d * IShape.PPC, rec.getWidth(), 0.001);
assertEquals(49d * IShape.PPC, rec.getHeight(), 0.001);
}
use of net.sf.latexdraw.models.interfaces.shape.IRectangle in project latexdraw by arnobl.
the class TestParsingPsframe method testParse2CoordinatesTwoLastMissing.
@Test
public void testParse2CoordinatesTwoLastMissing() {
parser("\\psframe(0,0)(,)");
final IRectangle rec = getShapeAt(0);
assertEquals(0d, rec.getPosition().getX(), 0.001);
assertEquals(0d, rec.getPosition().getY(), 0.001);
assertEquals(IShape.PPC, rec.getWidth(), 0.001);
assertEquals(IShape.PPC, rec.getHeight(), 0.001);
}
use of net.sf.latexdraw.models.interfaces.shape.IRectangle in project latexdraw by arnobl.
the class TestParsingPsframe method testParse2CoordinatesInt.
@Test
public void testParse2CoordinatesInt() {
parser("\\psframe(10,20)(35,50)");
final IRectangle rec = getShapeAt(0);
assertEquals(10d * IShape.PPC, rec.getPosition().getX(), 0.001);
assertEquals(20d * -IShape.PPC, rec.getPosition().getY(), 0.001);
assertEquals(25d * IShape.PPC, rec.getWidth(), 0.001);
assertEquals(30d * IShape.PPC, rec.getHeight(), 0.001);
}
Aggregations