diff options
author | Karl Berry <karl@freefriends.org> | 2019-10-06 17:17:34 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2019-10-06 17:17:34 +0000 |
commit | 7f9f7dad00ea5f025578c491005835740f9ffd90 (patch) | |
tree | 011a87a78042a82ea3a18f5c08e60f6a3930bf0b /Build/source/utils/asymptote/pen.h | |
parent | 37d8fb68e502daabe6aa5f5ae9fb78191f275742 (diff) |
asy 2.56 sources
git-svn-id: svn://tug.org/texlive/trunk@52300 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/utils/asymptote/pen.h')
-rw-r--r-- | Build/source/utils/asymptote/pen.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Build/source/utils/asymptote/pen.h b/Build/source/utils/asymptote/pen.h index 1208f4a60cb..d9572eee5c9 100644 --- a/Build/source/utils/asymptote/pen.h +++ b/Build/source/utils/asymptote/pen.h @@ -136,14 +136,14 @@ inline bool operator == (const Transparency& a, const Transparency& b) { extern const char* BlendMode[]; extern const Int nBlendMode; +const double bytescale=256.0*(1.0-DBL_EPSILON); + // Map [0,1] to [0,255] inline unsigned int byte(double r) { if(r < 0.0) r=0.0; else if(r > 1.0) r=1.0; - int a=(int)(256.0*r); - if(a == 256) a=255; - return a; + return (int)(bytescale*r); } class pen; |