diff options
author | Michael R Sweet <michael.r.sweet@gmail.com> | 2019-02-21 12:45:33 -0500 |
---|---|---|
committer | Michael R Sweet <michael.r.sweet@gmail.com> | 2019-02-21 12:45:33 -0500 |
commit | f05517caabee68aa069fa258522b9cba7ccee917 (patch) | |
tree | 1d6022e7b0a27fb3e0afb3ecbffa565ef82d05c6 /cups/pwg-media.c | |
parent | 2db15a26b859197c7f14e22431c9557b16a2f42c (diff) | |
download | cups-f05517caabee68aa069fa258522b9cba7ccee917.tar.gz |
Media size matching now uses a tolerance of 0.5mm (rdar://33822024)
Diffstat (limited to 'cups/pwg-media.c')
-rw-r--r-- | cups/pwg-media.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/cups/pwg-media.c b/cups/pwg-media.c index 079faaa0f..00bb2ed61 100644 --- a/cups/pwg-media.c +++ b/cups/pwg-media.c @@ -1,9 +1,10 @@ /* * PWG media name API implementation for CUPS. * - * Copyright 2009-2017 by Apple Inc. + * Copyright 2009-2019 by Apple Inc. * - * Licensed under Apache License v2.0. See the file "LICENSE" for more information. + * Licensed under Apache License v2.0. See the file "LICENSE" for more + * information. */ /* @@ -21,6 +22,7 @@ #define _PWG_MEDIA_IN(p,l,a,x,y) {p, l, a, (int)(x * 2540), (int)(y * 2540)} #define _PWG_MEDIA_MM(p,l,a,x,y) {p, l, a, (int)(x * 100), (int)(y * 100)} +#define _PWG_EPSILON 50 /* Matching tolerance */ /* @@ -911,10 +913,11 @@ pwgMediaForSize(int width, /* I - Width in hundredths of millimeters */ { /* * Adobe uses a size matching algorithm with an epsilon of 5 points, which - * is just about 176/2540ths... + * is just about 176/2540ths... But a lot of international media sizes are + * very close so use 0.5mm (50/2540ths) as the maximum delta. */ - return (_pwgMediaNearSize(width, length, 176)); + return (_pwgMediaNearSize(width, length, _PWG_EPSILON)); } |