Open DanRathbun opened 2 years ago
That makes sense to allow a FormattedText
object. Would the expectation be that the text object is positioned in the expected location already so an anchor_point
wouldn't be necessary?
In the first overload (4 args) where the anchor point is not given, the Label
constructor would (if the text
argument is a FormattedText
object,) take the anchor point from the argument object.
For the 2nd overload (5 args) the Label
constructor would use it's 4th argument as an override to whatever the FormattedText
object's anchor point is.
It could also be true that coders might pass the 4th argument using the same point reference that they used for creating the FormattedText
object. I can also see that the latter might have been created with a temporary anchor point, and that code would calculate the anchor point for the label afterward, so I think that that Label
constructor should override the FormattedText
object in the 2nd overload.
I am new to playing with the LayOut API so I am not sure what the difference is for label.connection_type=
and the last anchor_type
argument of the 2nd (5 args) Label
constructor overload.
Also noticed there are no #target_point
and #anchor_point
getters for the Label
class for post creation data. Are these points supposed to be gotten from the #leader_line
Path
object ?
LayOut Ruby API Issue
Layout::Label
constructor will not acceptLayout::FormattedText
as 1st argument.This makes no sense. The constructor forces use of a plain ol'
String
argument even though the class docstring states ...In order to set the text of a
Label
toFormattedText
we are forced to passformatted_text.display_text
orformatted_text.plain_text
toLayout::Label::new
and afterward calllabel.text= formatted_text
.~