As Joerg Wunsch wrote: > + && (fabs(trans->rotation - M_PI) < 1E-6)) > + break;
> + if (fabs(trans->rotation - M_PI_2) < 1E-6 > + || fabs(trans->rotation - (M_PI+M_PI_2)) < 1E-6) { After thinking more about it, of course, two times fabs() is needed. diff --git a/src/gerb_image.c b/src/gerb_image.c index 257f055..fe72305 100644 --- a/src/gerb_image.c +++ b/src/gerb_image.c @@ -590,20 +590,16 @@ gerbv_image_copy_all_nets (gerbv_image_t *sourceImage, case GERBV_APTYPE_OVAL: if (trans->scaleX == trans->scaleY && trans->scaleX == 1.0 - && (fabs(trans->rotation) == M_PI - || fabs(trans->rotation) == DEG2RAD(180))) - break; /* DEG2RAD for calc error */ + && (fabs(fabs(trans->rotation) - M_PI) < 1E-6)) + break; aper = gerbv_image_duplicate_aperture ( destImage->aperture[newNet->aperture]); aper->parameter[0] *= trans->scaleX; aper->parameter[1] *= trans->scaleY; - if (fabs(trans->rotation) == M_PI_2 - || fabs(trans->rotation) == DEG2RAD(90) - || fabs(trans->rotation) == (M_PI+M_PI_2) - || fabs(trans->rotation) == DEG2RAD(270)) { - /* DEG2RAD for calc error */ + if (fabs(fabs(trans->rotation) - M_PI_2) < 1E-6 + || fabs(fabs(trans->rotation) - (M_PI+M_PI_2)) < 1E-6) { double t = aper->parameter[0]; aper->parameter[0] = aper->parameter[1]; aper->parameter[1] = t; -- cheers, Joerg .-.-. --... ...-- -.. . DL8DTL http://www.sax.de/~joerg/ Never trust an operating system you don't have sources for. ;-) ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot _______________________________________________ Gerbv-devel mailing list Gerbv-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gerbv-devel