I am implementing a custom view and I would like to have a “rotation” attribute that would rotate the drawing.
So I would like to implement something like this:
void MyCustomView::Draw(CDrawContext *ctx)
{
if(fRotation != 0) {
// save state
// apply rotation
}
ctx->draw...
ctx->draw...
ctx->draw...
...
if(fRotation != 0) {
// restore saved state
}
}
If I call ctx->getCurrentTransform() it returns a const object so I cannot modify it. There is no setCurrentTransform method. And the pushTransform method is protected.
How do I implement such a thing?
Thanks
Yan