use of net.sf.latexdraw.models.interfaces.shape.IRectangle in project latexdraw by arnobl.
the class TestParsingPsframe method testParse2CoordinatesIntOppositeAll.
@Test
public void testParse2CoordinatesIntOppositeAll() {
parser("\\psframe(35,50)(10,20)");
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);
}
use of net.sf.latexdraw.models.interfaces.shape.IRectangle in project latexdraw by arnobl.
the class TestParsingPsframe method testParamFramearcReset.
@Test
public void testParamFramearcReset() {
parser("\\psframe[framearc=0.2, framearc=0.3](35,20)");
final IRectangle rec = getShapeAt(0);
assertEquals(0.3, rec.getLineArc(), 0.00001);
}
use of net.sf.latexdraw.models.interfaces.shape.IRectangle in project latexdraw by arnobl.
the class TestParsingPsframe method testPssetunitxunit.
@Test
public void testPssetunitxunit() {
parser("\\psset{unit=2,xunit=3}\\psframe(1,1)(5,5)");
final IRectangle rec = getShapeAt(0);
assertEquals(2d * 3d * IShape.PPC, rec.getX(), 0.000001);
assertEquals(-2d * IShape.PPC, rec.getY(), 0.000001);
assertEquals(2d * 4d * 3d * 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 testCoordinatesPt.
@Test
public void testCoordinatesPt() {
parser("\\psframe(0,0)(35pt,20pt)");
final IRectangle rec = getShapeAt(0);
assertEquals(0d, rec.getPosition().getX(), 0.001);
assertEquals(0d, rec.getPosition().getY(), 0.001);
assertEquals(35d * IShape.PPC / PSTricksConstants.CM_VAL_PT, rec.getWidth(), 0.001);
assertEquals(20d * IShape.PPC / PSTricksConstants.CM_VAL_PT, rec.getHeight(), 0.001);
}
use of net.sf.latexdraw.models.interfaces.shape.IRectangle in project latexdraw by arnobl.
the class TestParsingPsframe method testParse2CoordinatesIntOppositeY.
@Test
public void testParse2CoordinatesIntOppositeY() {
parser("\\psframe(10,50)(35,20)");
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