fix: cr, return value
This commit is contained in:
parent
66f620f57b
commit
3d45f6ab51
2 changed files with 4 additions and 5 deletions
|
|
@ -968,16 +968,15 @@ func (obj *Object) GetDefaultSize(mtexts []*d2target.MText, ruler *textmeasure.R
|
|||
return &dims, nil
|
||||
}
|
||||
|
||||
func (obj *Object) IsInsideNearContainer() bool {
|
||||
func (obj *Object) OuterNearContainer() *Object {
|
||||
temp := obj
|
||||
for temp != nil {
|
||||
fmt.Println(temp.ID)
|
||||
if temp.Attributes.NearKey != nil {
|
||||
return true
|
||||
return temp
|
||||
}
|
||||
temp = temp.Parent
|
||||
}
|
||||
return false
|
||||
return nil
|
||||
}
|
||||
|
||||
type Edge struct {
|
||||
|
|
|
|||
|
|
@ -225,7 +225,7 @@ func boundingBox(g *d2graph.Graph) (tl, br *geo.Point) {
|
|||
y2 = math.Max(y2, obj.TopLeft.Y+obj.Height)
|
||||
}
|
||||
} else {
|
||||
if obj.IsInsideNearContainer() {
|
||||
if obj.OuterNearContainer() != nil {
|
||||
continue
|
||||
}
|
||||
x1 = math.Min(x1, obj.TopLeft.X)
|
||||
|
|
|
|||
Loading…
Reference in a new issue