diff options
| author | Niko Kiirala <niko@kiirala.com> | 2009-01-19 13:45:47 +0000 |
|---|---|---|
| committer | kiirala <kiirala@users.sourceforge.net> | 2009-01-19 13:45:47 +0000 |
| commit | b2b4e553672cb52d0082223df3588c78b6f5f52b (patch) | |
| tree | 095a827abb1ae7a300fda3c49768e478f16ce2cc /src | |
| parent | updated Russian translation (diff) | |
| download | inkscape-b2b4e553672cb52d0082223df3588c78b6f5f52b.tar.gz inkscape-b2b4e553672cb52d0082223df3588c78b6f5f52b.zip | |
Rounding errors in feComposite: patch by Preben S (bug 318134)
(bzr r7147)
Diffstat (limited to 'src')
| -rw-r--r-- | src/display/nr-filter-colormatrix.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/display/nr-filter-colormatrix.cpp b/src/display/nr-filter-colormatrix.cpp index e5dc3fb20..21e659a6a 100644 --- a/src/display/nr-filter-colormatrix.cpp +++ b/src/display/nr-filter-colormatrix.cpp @@ -80,10 +80,10 @@ int FilterColorMatrix::render(FilterSlot &slot, FilterUnits const &/*units*/) { g_warning("ColorMatrix: values parameter error. Wrong size: %i.", static_cast<int>(values.size())); return -1; } - double a04 = 255*values[4] + .5; - double a14 = 255*values[9] + .5; - double a24 = 255*values[14] + .5; - double a34 = 255*values[19] + .5; + double a04 = 255*values[4]; + double a14 = 255*values[9]; + double a24 = 255*values[14]; + double a34 = 255*values[19]; for (x=x0;x<x1;x++){ for (y=y0;y<y1;y++){ i = ((x-x0) + (x1-x0)*(y-y0))*4; @@ -158,9 +158,9 @@ int FilterColorMatrix::render(FilterSlot &slot, FilterUnits const &/*units*/) { b = in_data[i+2]; a = in_data[i+3]; - out_data[i] = CLAMP_D_TO_U8( r*a00 + g*a01 + b*a02 + .5 ); - out_data[i+1] = CLAMP_D_TO_U8( r*a10 + g*a11 + b*a12 + .5 ); - out_data[i+2] = CLAMP_D_TO_U8( r*a20 + g*a21 + b*a22 + .5 ); + out_data[i] = CLAMP_D_TO_U8( r*a00 + g*a01 + b*a02); + out_data[i+1] = CLAMP_D_TO_U8( r*a10 + g*a11 + b*a12); + out_data[i+2] = CLAMP_D_TO_U8( r*a20 + g*a21 + b*a22); out_data[i+3] = a; } } |
