mirror of
https://github.com/reactos/reactos.git
synced 2025-08-02 05:55:42 +00:00
[MSPAINT] Implement canvas rotation (#4360)
- Add Rotate90DegreeBlt function to dib.cpp. - Implement ImageModel::RotateNTimes90Degrees and SelectionModel::RotateNTimes90Degrees. - Improve ToolsModel::SetBackgroundTransparent. - Extend and improve SelectionModel::InsertFromHBITMAP. CORE-16634
This commit is contained in:
parent
6eccbe27ec
commit
2d90919047
9 changed files with 86 additions and 7 deletions
|
@ -245,11 +245,25 @@ void ImageModel::FlipVertically()
|
|||
|
||||
void ImageModel::RotateNTimes90Degrees(int iN)
|
||||
{
|
||||
if (iN == 2)
|
||||
switch (iN)
|
||||
{
|
||||
case 1:
|
||||
case 3:
|
||||
DeleteObject(hBms[(currInd + 1) % HISTORYSIZE]);
|
||||
hBms[(currInd + 1) % HISTORYSIZE] = Rotate90DegreeBlt(hDrawingDC, GetWidth(), GetHeight(), iN == 1);
|
||||
currInd = (currInd + 1) % HISTORYSIZE;
|
||||
if (undoSteps < HISTORYSIZE - 1)
|
||||
undoSteps++;
|
||||
redoSteps = 0;
|
||||
SelectObject(hDrawingDC, hBms[currInd]);
|
||||
imageSaved = FALSE;
|
||||
NotifyDimensionsChanged();
|
||||
break;
|
||||
case 2:
|
||||
CopyPrevious();
|
||||
StretchBlt(hDrawingDC, GetWidth() - 1, GetHeight() - 1, -GetWidth(), -GetHeight(), GetDC(),
|
||||
0, 0, GetWidth(), GetHeight(), SRCCOPY);
|
||||
break;
|
||||
}
|
||||
NotifyImageChanged();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue