use of net.sf.latexdraw.models.interfaces.shape.IRectangle in project latexdraw by arnobl.
the class TestParsingPsframe method testParamFramearcOK.
@Theory
public void testParamFramearcOK(@DoubleData(vals = { 0d, 1d, 0.5 }) final double arc) {
parser("\\psframe[framearc=" + arc + "](35,20)");
final IRectangle rec = getShapeAt(0);
assertEquals(arc, rec.getLineArc(), 0.00001);
}
use of net.sf.latexdraw.models.interfaces.shape.IRectangle in project latexdraw by arnobl.
the class TestParsingPsframe method testParse2CoordinatesFloat2.
@Test
public void testParse2CoordinatesFloat2() {
parser("\\psframe(.5,.5)(35.5,50.5)");
final IRectangle rec = getShapeAt(0);
assertEquals(0.5 * IShape.PPC, rec.getPosition().getX(), 0.001);
assertEquals(0.5 * -IShape.PPC, rec.getPosition().getY(), 0.001);
assertEquals(35d * IShape.PPC, rec.getWidth(), 0.001);
assertEquals(50d * IShape.PPC, rec.getHeight(), 0.001);
}
use of net.sf.latexdraw.models.interfaces.shape.IRectangle in project latexdraw by arnobl.
the class TestParsingPsframe method testCoordinatesInch.
@Test
public void testCoordinatesInch() {
parser("\\psframe(0,0)(35in,20in)");
final IRectangle rec = getShapeAt(0);
assertEquals(0d, rec.getPosition().getX(), 0.001);
assertEquals(0d, rec.getPosition().getY(), 0.001);
assertEquals(35d * IShape.PPC / 2.54, rec.getWidth(), 0.001);
assertEquals(20d * IShape.PPC / 2.54, rec.getHeight(), 0.001);
}
use of net.sf.latexdraw.models.interfaces.shape.IRectangle in project latexdraw by arnobl.
the class TestParsingPsframe method testPssetunityunit.
@Test
public void testPssetunityunit() {
parser("\\psset{unit=2,yunit=3}\\psframe(1,1)(5,5)");
final IRectangle rec = getShapeAt(0);
assertEquals(2d * IShape.PPC, rec.getX(), 0.000001);
assertEquals(-2d * 3d * IShape.PPC, rec.getY(), 0.000001);
assertEquals(2d * 4d * IShape.PPC, rec.getWidth(), 0.000001);
assertEquals(2d * 4d * 3d * IShape.PPC, rec.getHeight(), 0.000001);
}
use of net.sf.latexdraw.models.interfaces.shape.IRectangle in project latexdraw by arnobl.
the class TestParsingPsframe method testParse2CoordinatesFloat.
@Test
public void testParse2CoordinatesFloat() {
parser("\\psframe(10.5,20.5)(35.5,50.5)");
final IRectangle rec = getShapeAt(0);
assertEquals(10.5 * IShape.PPC, rec.getPosition().getX(), 0.001);
assertEquals(20.5 * -IShape.PPC, rec.getPosition().getY(), 0.001);
assertEquals(25d * IShape.PPC, rec.getWidth(), 0.001);
assertEquals(30d * IShape.PPC, rec.getHeight(), 0.001);
}
Aggregations