use of net.sf.latexdraw.model.api.shape.Rectangle 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 Rectangle rec = getShapeAt(0);
assertEquals(10.5 * Shape.PPC, rec.getPosition().getX(), 0.001);
assertEquals(20.5 * -Shape.PPC, rec.getPosition().getY(), 0.001);
assertEquals(25d * Shape.PPC, rec.getWidth(), 0.001);
assertEquals(30d * Shape.PPC, rec.getHeight(), 0.001);
}
use of net.sf.latexdraw.model.api.shape.Rectangle in project latexdraw by arnobl.
the class TestParsingPsframe method testParse2CoordinatesFloatSigns.
@Test
public void testParse2CoordinatesFloatSigns() {
parser("\\psframe(-+-.5,+--.5)(+++35.5,--50.5)");
final Rectangle rec = getShapeAt(0);
assertEquals(0.5 * Shape.PPC, rec.getPosition().getX(), 0.001);
assertEquals(0.5 * -Shape.PPC, rec.getPosition().getY(), 0.001);
assertEquals(35d * Shape.PPC, rec.getWidth(), 0.001);
assertEquals(50d * Shape.PPC, rec.getHeight(), 0.001);
}
use of net.sf.latexdraw.model.api.shape.Rectangle in project latexdraw by arnobl.
the class TestParsingPsframe method testParse2CoordinatesIntOppositeX.
@Test
public void testParse2CoordinatesIntOppositeX() {
parser("\\psframe(35,20)(10,50)");
final Rectangle rec = getShapeAt(0);
assertEquals(10d * Shape.PPC, rec.getPosition().getX(), 0.001);
assertEquals(20d * -Shape.PPC, rec.getPosition().getY(), 0.001);
assertEquals(25d * Shape.PPC, rec.getWidth(), 0.001);
assertEquals(30d * Shape.PPC, rec.getHeight(), 0.001);
}
use of net.sf.latexdraw.model.api.shape.Rectangle in project latexdraw by arnobl.
the class TestParsingPsframe method testParse2CoordinatesIntOppositeY.
@Test
public void testParse2CoordinatesIntOppositeY() {
parser("\\psframe(10,50)(35,20)");
final Rectangle rec = getShapeAt(0);
assertEquals(10d * Shape.PPC, rec.getPosition().getX(), 0.001);
assertEquals(20d * -Shape.PPC, rec.getPosition().getY(), 0.001);
assertEquals(25d * Shape.PPC, rec.getWidth(), 0.001);
assertEquals(30d * Shape.PPC, rec.getHeight(), 0.001);
}
use of net.sf.latexdraw.model.api.shape.Rectangle in project latexdraw by arnobl.
the class TestParsingPsframe method testCoordinatesMm.
@Test
public void testCoordinatesMm() {
parser("\\psframe(0,0)(350mm,200mm)");
final Rectangle rec = getShapeAt(0);
assertEquals(0d, rec.getPosition().getX(), 0.001);
assertEquals(0d, rec.getPosition().getY(), 0.001);
assertEquals(35d * Shape.PPC, rec.getWidth(), 0.001);
assertEquals(20d * Shape.PPC, rec.getHeight(), 0.001);
}
Aggregations