use of net.sf.latexdraw.model.api.shape.Rhombus in project latexdraw by arnobl.
the class TestParsingPsdiamond method testCoordinatesPt.
@Test
public void testCoordinatesPt() {
parser("\\psdiamond(0,0)(35pt,20pt)");
final Rhombus rh = getShapeAt(0);
assertEquals(-35d * Shape.PPC / PSTricksConstants.CM_VAL_PT, rh.getPosition().getX(), 0.001);
assertEquals(-20d * Shape.PPC / PSTricksConstants.CM_VAL_PT * -1d, rh.getPosition().getY(), 0.001);
assertEquals(35d * Shape.PPC / PSTricksConstants.CM_VAL_PT * 2d, rh.getWidth(), 0.001);
assertEquals(20d * Shape.PPC / PSTricksConstants.CM_VAL_PT * 2d, rh.getHeight(), 0.001);
}
use of net.sf.latexdraw.model.api.shape.Rhombus in project latexdraw by arnobl.
the class TestParsingPsdiamond method testParse1Coordinates.
@Test
public void testParse1Coordinates() {
parser("\\psdiamond(35,20)");
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 testGangle.
@Test
public void testGangle() {
parser("\\psdiamond[gangle=90](0,0)(1,1)");
final Rhombus rh = getShapeAt(0);
assertEquals(-Math.PI / 2d, rh.getRotationAngle(), 0.001);
}
Aggregations