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
|
return &dims, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (obj *Object) IsInsideNearContainer() bool {
|
func (obj *Object) OuterNearContainer() *Object {
|
||||||
temp := obj
|
temp := obj
|
||||||
for temp != nil {
|
for temp != nil {
|
||||||
fmt.Println(temp.ID)
|
|
||||||
if temp.Attributes.NearKey != nil {
|
if temp.Attributes.NearKey != nil {
|
||||||
return true
|
return temp
|
||||||
}
|
}
|
||||||
temp = temp.Parent
|
temp = temp.Parent
|
||||||
}
|
}
|
||||||
return false
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type Edge struct {
|
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)
|
y2 = math.Max(y2, obj.TopLeft.Y+obj.Height)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if obj.IsInsideNearContainer() {
|
if obj.OuterNearContainer() != nil {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
x1 = math.Min(x1, obj.TopLeft.X)
|
x1 = math.Min(x1, obj.TopLeft.X)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue