mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 05:12:55 +00:00
[MSPAINT] Introduce partial image history (#5994)
- Add IMAGE_PART structure and use as history items. - Overload ImageModel::PushImageForUndo(const RECT& rcPartial). - Add ToolsModel::GetToolSize. - Implement partial image history on TwoPointDrawTool. CORE-19094
This commit is contained in:
parent
416d63026e
commit
72081168fb
5 changed files with 118 additions and 18 deletions
|
@ -202,6 +202,47 @@ void ToolsModel::SetRubberRadius(int nRubberRadius)
|
|||
NotifyToolSettingsChanged();
|
||||
}
|
||||
|
||||
SIZE ToolsModel::GetToolSize() const
|
||||
{
|
||||
SIZE size;
|
||||
switch (m_activeTool)
|
||||
{
|
||||
case TOOL_FREESEL:
|
||||
case TOOL_RECTSEL:
|
||||
case TOOL_COLOR:
|
||||
case TOOL_ZOOM:
|
||||
case TOOL_TEXT:
|
||||
case TOOL_FILL:
|
||||
size.cx = size.cy = 1;
|
||||
break;
|
||||
case TOOL_LINE:
|
||||
case TOOL_BEZIER:
|
||||
case TOOL_RECT:
|
||||
case TOOL_RRECT:
|
||||
case TOOL_SHAPE:
|
||||
case TOOL_ELLIPSE:
|
||||
size.cx = size.cy = GetLineWidth();
|
||||
break;
|
||||
case TOOL_AIRBRUSH:
|
||||
size.cx = size.cy = GetAirBrushRadius() * 2;
|
||||
break;
|
||||
case TOOL_RUBBER:
|
||||
size.cx = size.cy = GetRubberRadius() * 2;
|
||||
break;
|
||||
case TOOL_BRUSH:
|
||||
size.cx = size.cy = GetBrushWidth();
|
||||
break;
|
||||
case TOOL_PEN:
|
||||
size.cx = size.cy = GetPenWidth();
|
||||
break;
|
||||
}
|
||||
if (size.cx < 1)
|
||||
size.cx = 1;
|
||||
if (size.cy < 1)
|
||||
size.cy = 1;
|
||||
return size;
|
||||
}
|
||||
|
||||
BOOL ToolsModel::IsBackgroundTransparent() const
|
||||
{
|
||||
return m_transpBg;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue