Skip to content

Commit

Permalink
EGE/src/ege/viewport.cpp: 函数 clearviewport 使用背景颜色填充。
Browse files Browse the repository at this point in the history
参见 wysaid/xege#12 。

Signed-off-by: FrankHB <frankhb1989@gmail.com>
  • Loading branch information
FrankHB committed Apr 14, 2020
1 parent 6efb9e2 commit 0a7d785
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
4 changes: 3 additions & 1 deletion Compatibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ YEGE 以 [misakamm 的 xege](http://github.com/misakamm/xege) 为基础修改,
* 撤销 14.01 的修改,和原始 misakamm/xege 的 `color_t` 一致,而不再和 `::COLORREF` 一致。
* 同时修改函数 `EGERGB` 的实现,解决和其它函数的不一致问题。
* 修改后的格式和 `YSLib::Pixel` 在 Win32 上的实现以及 [wysaid/xege pull request 12](https://github.com/wysaid/xege/pull/12) 中的像素格式保持一致,存储格式都为 BGRA8888 。

* 函数 `clearviewport` 使用背景颜色填充。
* 参见 [wysaid/xege pull request 12](https://github.com/wysaid/xege/pull/12) 。

## 19.01

YEGE 19.01 以 YEGE 14.01 为基础修改。
Expand Down
8 changes: 1 addition & 7 deletions EGE/src/ege/viewport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,7 @@ clearviewport(IMAGE* pimg)
{
::RECT rect{0, 0, img.m_vpt.right - img.m_vpt.left,
img.m_vpt.bottom - img.m_vpt.top};
::HBRUSH hbr_c = ::HBRUSH(::GetCurrentObject(img.getdc(),
OBJ_BRUSH));
::LOGBRUSH logBrush;

::GetObjectW(hbr_c, sizeof(logBrush), &logBrush);

::HBRUSH hbr(::CreateSolidBrush(logBrush.lbColor));
const auto hbr(::CreateSolidBrush(GetBkColor(img.getdc())));

::FillRect(img.getdc(), &rect, hbr);
::DeleteObject(hbr);
Expand Down

0 comments on commit 0a7d785

Please sign in to comment.