use of net.sf.latexdraw.parsers.svg.path.SVGPathSegCurvetoQuadraticSmooth in project latexdraw by arnobl.
the class TestSVGPathSegCurvetoQuadraticSmooth method testToString.
@Test
public void testToString() throws ParseException {
SVGPathSegMoveto m = new SVGPathSegMoveto(0d, 0d, false);
SVGPathParser parser = new SVGPathParser(m.toString() + " " + seg.toString(), pathSeg -> {
if (pathSeg instanceof SVGPathSegMoveto && cpt == 0) {
cpt++;
return;
}
assertTrue(pathSeg instanceof SVGPathSegCurvetoQuadraticSmooth);
SVGPathSegCurvetoQuadraticSmooth seg2 = (SVGPathSegCurvetoQuadraticSmooth) pathSeg;
assertEquals(seg.getX(), seg2.getX(), 0.0001);
assertEquals(seg.getY(), seg2.getY(), 0.0001);
assertEquals(seg.isRelative(), seg2.isRelative());
});
parser.parse();
}
use of net.sf.latexdraw.parsers.svg.path.SVGPathSegCurvetoQuadraticSmooth in project latexdraw by arnobl.
the class SVGPathParser method parseShorthandQuadraticBezierCurveto.
/**
* Parses an SVGPath quadratic smooth curveto.
* @param isRelative True if segment is relative.
* @throws ParseException If a problem occurs.
*/
protected void parseShorthandQuadraticBezierCurveto(final boolean isRelative) throws ParseException {
nextChar();
skipWSP();
final double x = parseNumber(false);
skipWSPComma();
final double y = parseNumber(false);
skipWSPComma();
handler.onPathSeg(new SVGPathSegCurvetoQuadraticSmooth(x, y, isRelative));
parserPathSeg(isRelative);
}
use of net.sf.latexdraw.parsers.svg.path.SVGPathSegCurvetoQuadraticSmooth in project latexdraw by arnobl.
the class TestSVGPathSegCurvetoQuadraticSmooth method setUp.
@Before
public void setUp() {
seg = new SVGPathSegCurvetoQuadraticSmooth(-5.23e-10, 6.5, false);
cpt = 0;
}
Aggregations