2016-01-03 09:24 UTC-0800 Pritpal Bedi (bedipritpal/at/hotmail.com)

* contrib/gtwvg/wvgcore.c
  * contrib/gtwvg/wvgcuig.c
    ! Fixed Wvt_DrawImage() and Wvg_Image() where images were not
	   being rendered correctly if the height of image is greater than
	   width of the image. The behavior is only affected when <bDoNotScale>
	   is set to be TRUE. Thanks Sergy for reporting and providing
	   code to debug.
This commit is contained in:
Pritpal Bedi
2016-01-03 09:31:49 -08:00
parent 0bd3886ba3
commit b29e6acfc3
3 changed files with 29 additions and 4 deletions

View File

@@ -10,6 +10,15 @@
* Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment
*/
2016-01-03 09:24 UTC-0800 Pritpal Bedi (bedipritpal/at/hotmail.com)
* contrib/gtwvg/wvgcore.c
* contrib/gtwvg/wvgcuig.c
! Fixed Wvt_DrawImage() and Wvg_Image() where images were not
being rendered correctly if the height of image is greater than
width of the image. The behavior is only affected when <bDoNotScale>
is set to be TRUE. Thanks Sergy for reporting and providing
code to debug.
2015-12-29 20:16 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* include/hbcomp.h
* include/hbcompdf.h

View File

@@ -538,8 +538,16 @@ HB_BOOL hb_wvt_DrawImage( HDC hdc, int x, int y, int wd, int ht, LPCTSTR lpImage
if( bDoNotScale )
{
iHt = ( int ) ( ( float ) wd * lHeight / lWidth );
iWd = ( int ) ( ( float ) iHt * lWidth / lHeight );
if( lHeight > lWidth )
{
iWd = ( int ) ( ( float ) ht * lWidth / lHeight );
iHt = ( int ) ( ( float ) iWd * lHeight / lWidth );
}
else
{
iHt = ( int ) ( ( float ) wd * lHeight / lWidth );
iWd = ( int ) ( ( float ) iHt * lWidth / lHeight );
}
x += abs( ( iWd - wd ) / 2 );
y += abs( ( iHt - ht ) / 2 );
wd = iWd;

View File

@@ -1534,8 +1534,16 @@ static void hb_wvg_RenderPicture( PHB_GTWVT pWVT, PHB_GOBJS gObj, int iLeft, int
if( gObj->iData == 1 )
{
iHt = ( int ) ( ( float ) wd * lHeight / lWidth );
iWd = ( int ) ( ( float ) iHt * lWidth / lHeight );
if( lHeight > lWidth )
{
iWd = ( int ) ( ( float ) ht * lWidth / lHeight );
iHt = ( int ) ( ( float ) iWd * lHeight / lWidth );
}
else
{
iHt = ( int ) ( ( float ) wd * lHeight / lWidth );
iWd = ( int ) ( ( float ) iHt * lWidth / lHeight );
}
x += abs( ( iWd - wd ) / 2 );
y += abs( ( iHt - ht ) / 2 );
wd = iWd;