From 4918f0192e9ed8b9ca87a6c753517799d7c0bb62 Mon Sep 17 00:00:00 2001 From: FrankHB Date: Tue, 14 Apr 2020 17:33:48 +0800 Subject: [PATCH] =?UTF-8?q?EGE/src/ege/image.cpp:=20=E4=BF=AE=E5=A4=8D=20p?= =?UTF-8?q?utimage=5F*=20=E7=B3=BB=E5=88=97=E5=87=BD=E6=95=B0=E5=89=AA?= =?UTF-8?q?=E8=A3=81=E5=8C=BA=E5=9F=9F=E5=92=8C=E5=9D=90=E6=A0=87=E5=8F=98?= =?UTF-8?q?=E6=8D=A2=E7=9A=84=E9=97=AE=E9=A2=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 参见 https://github.com/wysaid/xege/pull/5 。 参见 https://github.com/wysaid/xege/pull/9 。 Signed-off-by: FrankHB --- Compatibility.md | 3 +++ EGE/src/ege/image.cpp | 8 +++++--- 2 files changed, 8 insertions(+), 3 deletions(-) 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; }