Skip to content

Commit

Permalink
Merge pull request qdtroy#160 from ty2570/patch-2
Browse files Browse the repository at this point in the history
Update UIRing.cpp
  • Loading branch information
qdtroy authored Oct 17, 2022
2 parents 44793c8 + 2628b37 commit 4d14409
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion DuiLib/Control/UIRing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,15 @@ namespace DuiLib
int iWidth = rcItem.right - rcItem.left;
int iHeight = rcItem.bottom - rcItem.top;
Gdiplus::PointF centerPos(rcItem.left + iWidth/2, rcItem.top + iHeight/2);

// 解决偶数时抖动问题
if ((iWidth % 2) == 0) centerPos.X -= 0.5;
if ((iHeight % 2) == 0) centerPos.Y -= 0.5;

Gdiplus::Graphics graphics(hDC);
graphics.TranslateTransform(centerPos.X,centerPos.Y);
graphics.RotateTransform(m_fCurAngle);
graphics.TranslateTransform(-centerPos.X, -centerPos.Y);//»¹Ô­Ô´µã
graphics.TranslateTransform(-centerPos.X, -centerPos.Y);//»¹Ô­Ô´µã
graphics.DrawImage(m_pBkimage,rcItem.left,rcItem.top,iWidth,iHeight);
}
}
Expand Down

0 comments on commit 4d14409

Please sign in to comment.