hypeartist / fog

Automatically exported from code.google.com/p/fog
0 stars 0 forks source link

_FOG_RASTER_IMAGE_PARAMS is incorrect #49

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Petr,

I came across this issue trying to use blitImage from image fragment and 
getting a blank result.

_FOG_RASTER_IMAGE_PARAMS macro defined in RasterPaintEngine.cpp and used in 
blitImage has incorrect test for image fragment validity. 

Currently it is using '-' for the test where '+' should be used:
...
if ((uint)(sX) >= (uint)sW || \
        (uint)(sY) >= (uint)sH || \
        (uint)(_ImageFragment_->w - sX) > (uint)sW || \
        (uint)(_ImageFragment_->h - sY) > (uint)sH) \
    { \
..

Correct  definition :
...
if ((uint)(sX) >= (uint)sW || \
        (uint)(sY) >= (uint)sH || \
        (uint)(_ImageFragment_->w + sX) > (uint)sW || \
        (uint)(_ImageFragment_->h + sY) > (uint)sH) \
    { \
...

Fixing this macro produced very nice results!
Thank you,
Pawel

Original issue reported on code.google.com by HBBRBa...@gmail.com on 9 Jan 2013 at 10:06

GoogleCodeExporter commented 8 years ago
Thank you, will be fixed!

Original comment by kobalicek.petr on 10 Jan 2013 at 11:47