fix: find outer near contaienr

This commit is contained in:
donglixiaoche 2023-03-31 22:54:44 +08:00
parent cea4355341
commit 063d438780
No known key found for this signature in database
GPG key ID: 3190E65EBAD6D6E2

View file

@ -970,9 +970,9 @@ func (obj *Object) GetDefaultSize(mtexts []*d2target.MText, ruler *textmeasure.R
func (obj *Object) OuterNearContainer() *Object {
temp := obj
// find outer near container that isn't itself
for temp != nil && temp != obj {
if temp.Attributes.NearKey != nil {
for temp != nil {
// find outer near container that isn't itself
if temp.Attributes.NearKey != nil && temp != obj {
return temp
}
temp = temp.Parent