textbaseline property not inherited by IDLgrText when specified in IDLgrAxis? [message #78925] |
Tue, 10 January 2012 08:02  |
Brian Daniel
Messages: 80 Registered: July 2009
|
Member |
|
|
Hi all,
I'm relatively new to object graphics. I've been playing with Michael
Galloy's mg_show_axes.pro routine and I wanted to extend his ability
to reorient the labels to be readable when the user has rotated the
axes. I wanted to extend that to the text labels on the axes
themselves.
Mike uses the textbaseline property of the axis object to do this.
xaxis->setProperty, textbaseline=[(newTransform[2, 2] gt 0 ? 1 : -1),
0, 0]
yaxis->setProperty, textbaseline=[0, (newTransform[2, 2] gt 0 ? 1 :
-1), 0]
zaxis->setProperty, textbaseline=[0, 0, (newTransform[1, 2] gt 0 ?
-1 : 1)]
where newTransform is the output of the trackball widget. Considering
the text object is inherited by the axis object, I thought that this
property would apply to the text object as well. Unfortunately, that
is not the case. Therefore, in the same location as Mike applies the
above transformation, I explicitly change the baseline property of the
text object via:
xaxis->getProperty, title=xText
yaxis->getProperty, title=yText
zaxis->getProperty, title=zText
xText->setProperty, baseline=[(newTransform[2, 2] gt 0 ? 1 : -1), 0,
0]
yText->setProperty, baseline=[0, (newTransform[2, 2] gt 0 ? 1 : -1),
0]
zText->setProperty, baseline=[0, 0, (newTransform[1, 2] gt 0 ? -1 :
1)]
xaxis->setProperty, title=xText
yaxis->setProperty, title=yText
zaxis->setProperty, title=zText
This doesn't work either. Does anyone (cough, Dr. Galloy, cough) have
any suggestions? Thanks.
-Brian
|
|
|