diff --git a/Compatibility.md b/Compatibility.md index 494b0765..8f69e622 100644 --- a/Compatibility.md +++ b/Compatibility.md @@ -10,6 +10,9 @@ YEGE 以 [misakamm 的 xege](http://github.com/misakamm/xege) 为基础修改, * 函数 `ege::getkey` 支持 `WM_CHAR` 消息。 * 参见 [wysaid/xege pull request 3](https://github.com/wysaid/xege/pull/3) 。 +* 修复 `putimage_`* 系列函数剪裁区域和坐标变换的问题。 + * 参见 [wysaid/xege pull request 5](https://github.com/wysaid/xege/pull/5) 。 + * 参见 [wysaid/xege pull request 9](https://github.com/wysaid/xege/pull/9) 。 ## 19.01 diff --git a/EGE/src/ege/image.cpp b/EGE/src/ege/image.cpp index 2369d778..2b7e79de 100644 --- a/EGE/src/ege/image.cpp +++ b/EGE/src/ege/image.cpp @@ -786,7 +786,9 @@ fix_rect_1size(IMAGE* pdest, IMAGE* psrc, int* nHeightSrc // height of source rectangle ) { - viewporttype _vpt{0, 0, int(pdest->GetWidth()), int(pdest->GetHeight()), 0}; + const auto& _vpt(pdest->m_vpt); + + yunseq(*nXOriginDest += _vpt.left, *nYOriginDest += _vpt.top); /* default value proc */ if(*nWidthSrc == 0) { @@ -835,13 +837,13 @@ fix_rect_1size(IMAGE* pdest, IMAGE* psrc, } if(*nXOriginDest + *nWidthSrc > _vpt.right) { - int dx = *nXOriginDest + *nWidthSrc - _vpt.right + 1; + int dx = *nXOriginDest + *nWidthSrc - _vpt.right; *nWidthSrc -= dx; } if(*nYOriginDest + *nHeightSrc > _vpt.bottom) { - int dy = *nYOriginDest + *nHeightSrc - _vpt.bottom + 1; + int dy = *nYOriginDest + *nHeightSrc - _vpt.bottom; *nHeightSrc -= dy; }