| | 1852 | break; |
| | 1853 | } |
| | 1854 | /* |
| | 1855 | Add sub-path knot |
| | 1856 | */ |
| | 1857 | for (i=0; i < 3; i++) |
| | 1858 | { |
| | 1859 | unsigned long |
| | 1860 | xx, |
| | 1861 | yy; |
| | 1862 | |
| | 1863 | yy=ReadPropertyMSBLong(&blob,&length); |
| | 1864 | xx=ReadPropertyMSBLong(&blob,&length); |
| | 1865 | x=(long) xx; |
| | 1866 | if (xx > 2147483647) |
| | 1867 | x=xx-4294967295-1; |
| | 1868 | y=(long) yy; |
| | 1869 | if (yy > 2147483647) |
| | 1870 | y=yy-4294967295-1; |
| | 1871 | point[i].x=(double) x*columns/4096/4096; |
| | 1872 | point[i].y=(double) y*rows/4096/4096; |
| | 1873 | } |
| | 1874 | if (in_subpath == MagickFalse) |
| | 1875 | { |
| | 1876 | (void) FormatMagickString(message,MaxTextExtent,"M %g,%g\n", |
| | 1877 | point[1].x,point[1].y); |
| | 1878 | for (i=0; i < 3; i++) |
| | 1879 | { |
| | 1880 | first[i]=point[i]; |
| | 1881 | last[i]=point[i]; |
| | 1882 | } |
| 1845 | | /* |
| 1846 | | Add sub-path knot |
| 1847 | | */ |
| | 1886 | if ((last[1].x == last[2].x) && (last[1].y == last[2].y) && |
| | 1887 | (point[0].x == point[1].x) && (point[0].y == point[1].y)) |
| | 1888 | (void) FormatMagickString(message,MaxTextExtent,"L %g,%g\n", |
| | 1889 | point[1].x,point[1].y); |
| | 1890 | else |
| | 1891 | (void) FormatMagickString(message,MaxTextExtent, |
| | 1892 | "C %g,%g %g,%g %g,%g\n",last[2].x,last[2].y, |
| | 1893 | point[0].x,point[0].y,point[1].x,point[1].y); |
| 1849 | | { |
| 1850 | | y=(long) ReadPropertyMSBLong(&blob,&length); |
| 1851 | | x=(long) ReadPropertyMSBLong(&blob,&length); |
| 1852 | | point[i].x=(double) x*columns/4096/4096; |
| 1853 | | point[i].y=(double) y*rows/4096/4096; |
| 1854 | | } |
| 1855 | | if (in_subpath == MagickFalse) |
| 1856 | | { |
| 1857 | | (void) FormatMagickString(message,MaxTextExtent,"M %g,%g\n", |
| 1858 | | point[1].x,point[1].y); |
| 1859 | | for (i=0; i < 3; i++) |
| 1860 | | { |
| 1861 | | first[i]=point[i]; |
| 1862 | | last[i]=point[i]; |
| 1863 | | } |
| 1864 | | } |
| | 1895 | last[i]=point[i]; |
| | 1896 | } |
| | 1897 | (void) ConcatenateString(&path,message); |
| | 1898 | in_subpath=MagickTrue; |
| | 1899 | knot_count--; |
| | 1900 | /* |
| | 1901 | Close the subpath if there are no more knots. |
| | 1902 | */ |
| | 1903 | if (knot_count == 0) |
| | 1904 | { |
| | 1905 | if ((last[1].x == last[2].x) && (last[1].y == last[2].y) && |
| | 1906 | (first[0].x == first[1].x) && (first[0].y == first[1].y)) |
| | 1907 | (void) FormatMagickString(message,MaxTextExtent,"L %g,%g Z\n", |
| | 1908 | first[1].x,first[1].y); |
| 1867 | | if ((last[1].x == last[2].x) && (last[1].y == last[2].y) && |
| 1868 | | (point[0].x == point[1].x) && (point[0].y == point[1].y)) |
| 1869 | | (void) FormatMagickString(message,MaxTextExtent,"L %g,%g\n", |
| 1870 | | point[1].x,point[1].y); |
| 1871 | | else |
| 1872 | | (void) FormatMagickString(message,MaxTextExtent, |
| 1873 | | "C %g,%g %g,%g %g,%g\n",last[2].x,last[2].y, |
| 1874 | | point[0].x,point[0].y,point[1].x,point[1].y); |
| 1875 | | for (i=0; i < 3; i++) |
| 1876 | | last[i]=point[i]; |
| | 1911 | (void) FormatMagickString(message,MaxTextExtent, |
| | 1912 | "C %g,%g %g,%g %g,%g Z\n",last[2].x,last[2].y, |
| | 1913 | first[0].x,first[0].y,first[1].x,first[1].y); |
| | 1914 | (void) ConcatenateString(&path,message); |
| 1878 | | (void) ConcatenateString(&path,message); |
| 1879 | | in_subpath=MagickTrue; |
| 1880 | | knot_count--; |
| 1881 | | /* |
| 1882 | | Close the subpath if there are no more knots. |
| 1883 | | */ |
| 1884 | | if (knot_count == 0) |
| 1885 | | { |
| 1886 | | if ((last[1].x == last[2].x) && (last[1].y == last[2].y) && |
| 1887 | | (first[0].x == first[1].x) && (first[0].y == first[1].y)) |
| 1888 | | (void) FormatMagickString(message,MaxTextExtent,"L %g,%g Z\n", |
| 1889 | | first[1].x,first[1].y); |
| 1890 | | else |
| 1891 | | { |
| 1892 | | (void) FormatMagickString(message,MaxTextExtent, |
| 1893 | | "C %g,%g %g,%g %g,%g Z\n",last[2].x,last[2].y, |
| 1894 | | first[0].x,first[0].y,first[1].x,first[1].y); |
| 1895 | | (void) ConcatenateString(&path,message); |
| 1896 | | } |
| 1897 | | in_subpath=MagickFalse; |
| 1898 | | } |
| | 1916 | in_subpath=MagickFalse; |