|
@@ -643,11 +643,18 @@ get_frame_as_set() const {
|
|
|
// size of the current text; if the frame was set via
|
|
// size of the current text; if the frame was set via
|
|
|
// set_frame_actual(), this returns the values
|
|
// set_frame_actual(), this returns the values
|
|
|
// actually set.
|
|
// actually set.
|
|
|
|
|
+//
|
|
|
|
|
+// If the text has no frame at all, this returns the
|
|
|
|
|
+// dimensions of the text itself, as if the frame were
|
|
|
|
|
+// set with a margin of 0, 0, 0, 0.
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
INLINE LVecBase4f TextNode::
|
|
INLINE LVecBase4f TextNode::
|
|
|
get_frame_actual() const {
|
|
get_frame_actual() const {
|
|
|
- nassertr(has_frame(), LVecBase4f(0.0, 0.0, 0.0, 0.0));
|
|
|
|
|
- if (is_frame_as_margin()) {
|
|
|
|
|
|
|
+ if (!has_frame()) {
|
|
|
|
|
+ check_measure();
|
|
|
|
|
+ return LVecBase4f(_ul2d[0], _lr2d[0], _lr2d[1], _ul2d[1]);
|
|
|
|
|
+
|
|
|
|
|
+ } else if (is_frame_as_margin()) {
|
|
|
check_measure();
|
|
check_measure();
|
|
|
return LVecBase4f(_ul2d[0] - _frame_ul[0],
|
|
return LVecBase4f(_ul2d[0] - _frame_ul[0],
|
|
|
_lr2d[0] + _frame_lr[0],
|
|
_lr2d[0] + _frame_lr[0],
|
|
@@ -982,6 +989,29 @@ get_draw_order() const {
|
|
|
return _draw_order;
|
|
return _draw_order;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
|
|
+// Function: TextNode::set_tab_width
|
|
|
|
|
+// Access: Published
|
|
|
|
|
+// Description: Sets the width of each tab stop, in screen units. A
|
|
|
|
|
+// tab character embedded in the text will advance the
|
|
|
|
|
+// horizontal position to the next tab stop.
|
|
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
|
|
+INLINE void TextNode::
|
|
|
|
|
+set_tab_width(float tab_width) {
|
|
|
|
|
+ _tab_width = tab_width;
|
|
|
|
|
+ invalidate_with_measure();
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
|
|
+// Function: TextNode::get_tab_width
|
|
|
|
|
+// Access: Published
|
|
|
|
|
+// Description: Returns the width set via set_tab_width().
|
|
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
|
|
+INLINE float TextNode::
|
|
|
|
|
+get_tab_width() const {
|
|
|
|
|
+ return _tab_width;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
// Function: TextNode::set_transform
|
|
// Function: TextNode::set_transform
|
|
|
// Access: Published
|
|
// Access: Published
|