Home » U++ Library support » Draw, Display, Images, Bitmaps, Icons » Assertion fails in BufferPainter::TransformOp() with rotated text
Re: Assertion fails in BufferPainter::TransformOp() with rotated text [message #47293 is a reply to message #47288] |
Tue, 03 January 2017 11:41   |
 |
mirek
Messages: 14267 Registered: November 2005
|
Ultimate Member |
|
|
Tom1 wrote on Tue, 03 January 2017 09:55Hi,
When calling Painter::DrawText (for rotated text output):
...
painter.DrawText(x,y,rotation,text,font,Black());
...
The following assertion triggers in DEBUG mode:
void BufferPainter::TransformOp(const Xform2D& m)
{
ASSERT_(IsNull(current), "Cannot change transformation during path definition");
pathattr.mtx = attr.mtx = m * attr.mtx;
}
In RELEASE mode DrawText works just as it should, allowing rotation of text about its insertion point while retaining original transformation in the background (because of Begin()/End() pair involved). Similar temporary transformations are needed when rendering constant blocks of vector graphics at different locations with different scaling and rotation attributes. I guess Begin()/End() pairs should be used there too to preserve original transformation.
Is this assertion really needed for something?
Best regards,
Tom
Can you provide more context please? If I just do
void HelloWorld::Paint(Draw& w)
{
ImagePainter iw(GetSize());
iw.Clear(White());
iw.DrawText(500, 500, 20, "Hello World !", Arial(100));
w.DrawImage(0, 0, iw);
}
it works just fine...
|
|
|
Goto Forum:
Current Time: Mon Aug 25 18:42:32 CEST 2025
Total time taken to generate the page: 0.18667 seconds
|