blob: fed0c48766fea64e0933b2c29803df6bfdc7d851 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
#pragma once
#include "painter.hpp"
#include <functional>
namespace cru::platform::util {
inline void WithTransform(Painter* painter, const Matrix& matrix,
const std::function<void(Painter*)>& action) {
const auto old = painter->GetTransform();
painter->SetTransform(old * matrix);
action(painter);
painter->SetTransform(old);
}
}
|