Origin: https://sourceforge.net/p/mcj/tickets/187/ https://sourceforge.net/p/mcj/fig2dev/ci/1e5515a1ea2ec8651cf85ab5000d026bb962492a/ --- a/fig2dev/dev/genpict2e.c +++ b/fig2dev/dev/genpict2e.c @@ -3,7 +3,7 @@ * Copyright (c) 1991 by Micah Beck * Parts Copyright (c) 1985-1988 by Supoj Sutanthavibul * Parts Copyright (c) 1989-2015 by Brian V. Smith - * Parts Copyright (c) 2015-2023 by Thomas Loimer + * Parts Copyright (c) 2015-2025 by Thomas Loimer * * Any party obtaining a copy of these files is granted, free of charge, a * full and unrestricted irrevocable, world-wide, paid up, royalty-free, @@ -19,7 +19,7 @@ /* * genpict2e.c: convert fig to pict2e macro language for LaTeX * - * Author: Thomas Loimer, 2014-2023 + * Author: Thomas Loimer, 2014-2025 * Based on the latex picture driver, genlatex.c * */ @@ -2277,8 +2277,13 @@ l->join_style = MITERJOIN; p = l->points; - if (p == NULL) + for (i = 0; i < 8 && p != NULL; ++i) + p = p->next; + /* If the radius is about 1, the spline may consist of + a few points only. */ + if (i < 7) return; + p = l->points; /* * Walk along the spline, until the arc angle is covered. @@ -2428,7 +2433,7 @@ rad = 0.5*(sqrt((double)d1x*d1x + (double)d1y*d1y) + sqrt((double)d2x*d2x + (double)d2y*d2y)); rad = round(rad*10.0) / 10.0; - /* how precise must the angle be given? + /* how precise must the angle be given? 1/rad is the view angle of one pixel */ da = 180.0 / M_PI / rad; preca = 0;