From 7f9f7dad00ea5f025578c491005835740f9ffd90 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 6 Oct 2019 17:17:34 +0000 Subject: asy 2.56 sources git-svn-id: svn://tug.org/texlive/trunk@52300 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/utils/asymptote/pen.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Build/source/utils/asymptote/pen.h') 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; -- cgit v1.2.3