use of net.sf.latexdraw.model.api.shape.Rhombus in project latexdraw by arnobl.
the class TestParsingPsdiamond method testCoordinatesCm.
@Test
public void testCoordinatesCm() {
parser("\\psdiamond(0,0)(35cm,20cm)");
final Rhombus rh = getShapeAt(0);
assertEquals(-35d * Shape.PPC, rh.getPosition().getX(), 0.001);
assertEquals(-20d * Shape.PPC * -1d, rh.getPosition().getY(), 0.001);
assertEquals(35d * Shape.PPC * 2d, rh.getWidth(), 0.001);
assertEquals(20d * Shape.PPC * 2d, rh.getHeight(), 0.001);
}
use of net.sf.latexdraw.model.api.shape.Rhombus in project latexdraw by arnobl.
the class TestParsingPsdiamond method testParse2CoordinatesFloatSigns.
@Test
public void testParse2CoordinatesFloatSigns() {
parser("\\psdiamond(-+-.5,+--.5)(+++35.5,--50.5)");
final Rhombus rh = getShapeAt(0);
assertEquals(.5 * Shape.PPC - 35.5 * Shape.PPC, rh.getPosition().getX(), 0.001);
assertEquals(.5 * -Shape.PPC + 50.5 * Shape.PPC, rh.getPosition().getY(), 0.001);
assertEquals(35.5 * Shape.PPC * 2d, rh.getWidth(), 0.001);
assertEquals(50.5 * Shape.PPC * 2d, rh.getHeight(), 0.001);
}
use of net.sf.latexdraw.model.api.shape.Rhombus in project latexdraw by arnobl.
the class TestParsingPsdiamond method testCoordinatesMm.
@Test
public void testCoordinatesMm() {
parser("\\psdiamond(0,0)(350mm,200mm)");
final Rhombus rh = getShapeAt(0);
assertEquals(-35d * Shape.PPC, rh.getPosition().getX(), 0.001);
assertEquals(-20d * Shape.PPC * -1d, rh.getPosition().getY(), 0.001);
assertEquals(35d * Shape.PPC * 2d, rh.getWidth(), 0.001);
assertEquals(20d * Shape.PPC * 2d, rh.getHeight(), 0.001);
}
use of net.sf.latexdraw.model.api.shape.Rhombus in project latexdraw by arnobl.
the class TestParsingPsdiamond method testParse2CoordinatesFloat.
@Test
public void testParse2CoordinatesFloat() {
parser("\\psdiamond(10.5,20.5)(35.5,50.5)");
final Rhombus rh = getShapeAt(0);
assertEquals(10.5 * Shape.PPC - 35.5 * Shape.PPC, rh.getPosition().getX(), 0.001);
assertEquals(20.5 * -Shape.PPC + 50.5 * Shape.PPC, rh.getPosition().getY(), 0.001);
assertEquals(35.5 * Shape.PPC * 2d, rh.getWidth(), 0.001);
assertEquals(50.5 * Shape.PPC * 2d, rh.getHeight(), 0.001);
}
use of net.sf.latexdraw.model.api.shape.Rhombus in project latexdraw by arnobl.
the class TestParsingPsdiamond method testParse2CoordinatesFloat2.
@Test
public void testParse2CoordinatesFloat2() {
parser("\\psdiamond(.5,.5)(35.5,50.5)");
final Rhombus rh = getShapeAt(0);
assertEquals(.5 * Shape.PPC - 35.5 * Shape.PPC, rh.getPosition().getX(), 0.001);
assertEquals(.5 * -Shape.PPC + 50.5 * Shape.PPC, rh.getPosition().getY(), 0.001);
assertEquals(35.5 * Shape.PPC * 2d, rh.getWidth(), 0.001);
assertEquals(50.5 * Shape.PPC * 2d, rh.getHeight(), 0.001);
}
Aggregations