use of net.sf.latexdraw.model.api.shape.Text in project latexdraw by arnobl.
the class TestParsingRPut method testRefPointtr.
@Test
void testRefPointtr() {
parser("\\rput[tr](10,20){coucou}");
final Text txt = getShapeAt(0);
assertEquals(TextPosition.TOP_RIGHT, txt.getTextPosition());
assertEquals(10d * Shape.PPC, txt.getPosition().getX(), 0.001);
assertEquals(-20d * Shape.PPC, txt.getPosition().getY(), 0.001);
}
use of net.sf.latexdraw.model.api.shape.Text in project latexdraw by arnobl.
the class TestParsingRPut method testDoubleRputRotationMustNotRotateOtherShapes.
@Test
void testDoubleRputRotationMustNotRotateOtherShapes() {
parser("\\rput{10}(0,0){\\rput{80}(0,0){coucou}}\\psframe(10,10)");
final Text txt = getShapeAt(0);
final Rectangle rec = getShapeAt(1);
assertEquals(Math.toRadians(-90), txt.getRotationAngle(), 0.001);
assertEquals(0d, rec.getRotationAngle(), 0.001);
}
use of net.sf.latexdraw.model.api.shape.Text in project latexdraw by arnobl.
the class TestParsingRPut method testRPutCoordRotationNText.
@Test
void testRPutCoordRotationNText() {
parser("\\rput{N}(1,2){coucou}");
final Text txt = getShapeAt(0);
assertEquals("coucou", txt.getText());
assertEquals(Shape.PPC, txt.getPosition().getX(), 0.001);
assertEquals(-2d * Shape.PPC, txt.getPosition().getY(), 0.001);
assertEquals(0d, txt.getRotationAngle(), 0.001);
}
use of net.sf.latexdraw.model.api.shape.Text in project latexdraw by arnobl.
the class TestParsingRPut method testRPutCoordStarFloatText.
@Test
void testRPutCoordStarFloatText() {
parser("\\rput{*-90.8929}(1,2){coucou}");
final Text txt = getShapeAt(0);
assertEquals("coucou", txt.getText());
assertEquals(Shape.PPC, txt.getPosition().getX(), 0.001);
assertEquals(-2d * Shape.PPC, txt.getPosition().getY(), 0.001);
assertEquals(Math.toRadians(90.8929), txt.getRotationAngle(), 0.001);
}
use of net.sf.latexdraw.model.api.shape.Text in project latexdraw by arnobl.
the class TestParsingRPut method testRPutCoordRotationSText.
@Test
void testRPutCoordRotationSText() {
parser("\\rput{S}(1,2){coucou}");
final Text txt = getShapeAt(0);
assertEquals("coucou", txt.getText());
assertEquals(Shape.PPC, txt.getPosition().getX(), 0.001);
assertEquals(-2d * Shape.PPC, txt.getPosition().getY(), 0.001);
assertEquals(Math.toRadians(-180d), txt.getRotationAngle(), 0.001);
}
Aggregations