Search in sources :

Example 1 with SVGPathSegCurvetoQuadraticSmooth

use of net.sf.latexdraw.parser.svg.path.SVGPathSegCurvetoQuadraticSmooth in project latexdraw by arnobl.

the class TestSVGPathSegCurvetoQuadraticSmooth method testToString.

@Test
public void testToString() {
    final AtomicBoolean done = new AtomicBoolean(false);
    final SVGPathSegMoveto m = new SVGPathSegMoveto(0d, 0d, false);
    SVGParserUtils.INSTANCE.parseSVGPath(m.toString() + " " + seg.toString(), pathSeg -> {
        if (pathSeg instanceof SVGPathSegMoveto) {
            return;
        }
        done.set(true);
        final SVGPathSegCurvetoQuadraticSmooth seg2 = (SVGPathSegCurvetoQuadraticSmooth) pathSeg;
        assertEquals(seg.getX(), seg2.getX(), 0.0001);
        assertEquals(seg.getY(), seg2.getY(), 0.0001);
        assertEquals(seg.isRelative(), seg2.isRelative());
    });
    assertTrue(done.get());
}
Also used : AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) SVGPathSegCurvetoQuadraticSmooth(net.sf.latexdraw.parser.svg.path.SVGPathSegCurvetoQuadraticSmooth) SVGPathSegMoveto(net.sf.latexdraw.parser.svg.path.SVGPathSegMoveto) Test(org.junit.jupiter.api.Test)

Aggregations

AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)1 SVGPathSegCurvetoQuadraticSmooth (net.sf.latexdraw.parser.svg.path.SVGPathSegCurvetoQuadraticSmooth)1 SVGPathSegMoveto (net.sf.latexdraw.parser.svg.path.SVGPathSegMoveto)1 Test (org.junit.jupiter.api.Test)1