Search in sources :

Example 6 with SVGPathSegLineto

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

the class TestSVGPathSegLineto method testToString.

@Test
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 SVGPathSegLineto seg2 = (SVGPathSegLineto) 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) SVGPathSegMoveto(net.sf.latexdraw.parser.svg.path.SVGPathSegMoveto) SVGPathSegLineto(net.sf.latexdraw.parser.svg.path.SVGPathSegLineto) Test(org.junit.jupiter.api.Test)

Aggregations

SVGPathSegLineto (net.sf.latexdraw.parser.svg.path.SVGPathSegLineto)6 SVGPathSegList (net.sf.latexdraw.parser.svg.path.SVGPathSegList)4 SVGPathSegMoveto (net.sf.latexdraw.parser.svg.path.SVGPathSegMoveto)4 SVGPathSegClosePath (net.sf.latexdraw.parser.svg.path.SVGPathSegClosePath)3 Point (net.sf.latexdraw.model.api.shape.Point)2 Point2D (java.awt.geom.Point2D)1 ArrayList (java.util.ArrayList)1 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)1 ArcStyle (net.sf.latexdraw.model.api.shape.ArcStyle)1 SVGDefsElement (net.sf.latexdraw.parser.svg.SVGDefsElement)1 SVGElement (net.sf.latexdraw.parser.svg.SVGElement)1 SVGGElement (net.sf.latexdraw.parser.svg.SVGGElement)1 SVGPathElement (net.sf.latexdraw.parser.svg.SVGPathElement)1 SVGPathSeg (net.sf.latexdraw.parser.svg.path.SVGPathSeg)1 SVGPathSegArc (net.sf.latexdraw.parser.svg.path.SVGPathSegArc)1 Test (org.junit.jupiter.api.Test)1