mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 05:17:34 +00:00
SharedGraphics: Add PainterStateSaver RAII helper and Point::operator-().
Two little things to help tidy up a bit in WSWindowManager.
This commit is contained in:
parent
3c2139b824
commit
88f6ce152f
3 changed files with 22 additions and 7 deletions
|
@ -80,3 +80,20 @@ private:
|
|||
Retained<GraphicsBitmap> m_target;
|
||||
Vector<State> m_state_stack;
|
||||
};
|
||||
|
||||
class PainterStateSaver {
|
||||
public:
|
||||
PainterStateSaver(Painter& painter)
|
||||
: m_painter(painter)
|
||||
{
|
||||
m_painter.save();
|
||||
}
|
||||
|
||||
~PainterStateSaver()
|
||||
{
|
||||
m_painter.restore();
|
||||
}
|
||||
|
||||
private:
|
||||
Painter& m_painter;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue