From 35539062e68abc89dc4e0fca7acc221db81342c6 Mon Sep 17 00:00:00 2001 From: BST 1999 Andy Thomas Date: Tue, 19 Oct 1999 20:56:51 +0000 Subject: [PATCH] app/layer.c Tue Oct 19 21:50:52 BST 1999 Andy Thomas * app/layer.c Fixed rounding error in preview generating code that produced dithering where no dithering should have been! --- ChangeLog | 7 +++++++ app/core/gimplayer.c | 2 +- app/gimplayer.c | 2 +- app/layer.c | 2 +- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4c30723531..bf1bdb9de6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Tue Oct 19 21:50:52 BST 1999 Andy Thomas + + * app/layer.c + + Fixed rounding error in preview generating code that + produced dithering where no dithering should have been! + 1999-10-19 Michael Natterer * gimpcontext.[ch]: changed the "parent context" implementation: diff --git a/app/core/gimplayer.c b/app/core/gimplayer.c index 24b83a4446..3a2248a6b7 100644 --- a/app/core/gimplayer.c +++ b/app/core/gimplayer.c @@ -1438,7 +1438,7 @@ layer_preview_scale (gint type, { b = bytes; while (b--) - *d++ = (unsigned char) (*r++ * tot_frac); + *d++ = (unsigned char) ((*r++ * tot_frac)+0.5); } dest += destwidth; diff --git a/app/gimplayer.c b/app/gimplayer.c index 24b83a4446..3a2248a6b7 100644 --- a/app/gimplayer.c +++ b/app/gimplayer.c @@ -1438,7 +1438,7 @@ layer_preview_scale (gint type, { b = bytes; while (b--) - *d++ = (unsigned char) (*r++ * tot_frac); + *d++ = (unsigned char) ((*r++ * tot_frac)+0.5); } dest += destwidth; diff --git a/app/layer.c b/app/layer.c index 24b83a4446..3a2248a6b7 100644 --- a/app/layer.c +++ b/app/layer.c @@ -1438,7 +1438,7 @@ layer_preview_scale (gint type, { b = bytes; while (b--) - *d++ = (unsigned char) (*r++ * tot_frac); + *d++ = (unsigned char) ((*r++ * tot_frac)+0.5); } dest += destwidth;