[MSPAINT] Add selectionModel.drawFrameOnCanvas and use it

Refactoring. CORE-19094
This commit is contained in:
Katayama Hirofumi MZ 2023-11-23 11:03:10 +09:00
parent c2bb5aa01d
commit 4a52a4b04c
4 changed files with 16 additions and 19 deletions

View file

@ -523,8 +523,7 @@ void SelectionModel::NotifyContentChanged()
void SelectionModel::SwapWidthAndHeight()
{
INT cx = m_rc.Width();
INT cy = m_rc.Height();
INT cx = m_rc.Width(), cy = m_rc.Height();
m_rc.right = m_rc.left + cy;
m_rc.bottom = m_rc.top + cx;
}
@ -540,6 +539,18 @@ HITTEST SelectionModel::hitTest(POINT ptCanvas)
return getSizeBoxHitTest(ptCanvas, &rcSelection);
}
void SelectionModel::drawFrameOnCanvas(HDC hCanvasDC)
{
if (!m_bShow)
return;
RECT rcSelection = m_rc;
canvasWindow.ImageToCanvas(rcSelection);
::InflateRect(&rcSelection, GRIP_SIZE, GRIP_SIZE);
drawSizeBoxes(hCanvasDC, &rcSelection, TRUE);
}
void SelectionModel::StretchSelection(BOOL bShrink)
{
if (!m_bShow)