Skip to content

Commit 3288ada

Browse files
committed
CIM-0 修复win下面拖动treelistctrl的时候图标因为需要显示一半而导致出错的问题(x会变成负数,导致DoGetAsBitmap会出错)
1 parent b1f9179 commit 3288ada

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/msw/dc.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2938,7 +2938,7 @@ static bool AlphaBlt(wxMSWDCImpl* dcDst,
29382938
wxMemoryDC dc(bmp);
29392939

29402940
// Fetch the content of the destination area into the temporary buffer.
2941-
wxRect r(x, y, dstWidth, dstHeight);
2941+
wxRect r(std::max<int>(0, x), std::max<int>(0, y), dstWidth, dstHeight);
29422942
if (bmpDst.GetWidth() < x + dstWidth || bmpDst.GetHeight() < y + dstHeight)
29432943
return true;
29442944
dc.DrawBitmap(dcDst->DoGetAsBitmap(&r), 0, 0);

0 commit comments

Comments
 (0)