
Mon, 03/25/2024 - 18:49
Hello all.
I'm facing a problem using AIS_TextLabel and the vertical alignement.
I'm placing such object near to a line with the SetPosition function (in fact at the center of a line).
When using the SetVJustification function with Graphic3d_VTA_TOP, the display is nice, there is a small space behind the line and the label (see in first attached screenshot [1-aligntop.jpg]).
But when using Graphic3d_VTA_BOTTOM, the text is really too near from the line (see in second attached screenshot [2-alignbottom.jpg]).
Does anyone knows a way to add a small margin when using bottom alignement or an option to configure to get a small space between the line and the text ?
My text always follows the line direction, updating its angle when the camera moves.
Thank you very much.
Tue, 03/26/2024 - 10:06
I think that
AIS_TextLabel
lacks an option for what you are trying to achieve. You would have to subclass this presentation or define your own to make this precisely. This could be done by adding a local transformation or adjusting transform persistence.What I may suggest is a workaround by using center alignment option and an extra empty line in text.
Tue, 03/26/2024 - 12:19
Nice hack !!
I just have to count number of lines to ensure that I add enough line breaks if the original text should have line breaks, but it works like a charm.
Thank you very much.