cleanup
This commit is contained in:
parent
94055a0c77
commit
0aa4418921
2 changed files with 5 additions and 5 deletions
|
|
@ -334,7 +334,7 @@ func (obj *Object) GetMargin() geo.Spacing {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if obj.Icon != nil && obj.IconPosition != nil && obj.Shape.Value != d2target.ShapeImage {
|
if obj.HasIcon() && obj.IconPosition != nil {
|
||||||
position := label.FromString(*obj.IconPosition)
|
position := label.FromString(*obj.IconPosition)
|
||||||
|
|
||||||
iconSize := float64(d2target.MAX_ICON_SIZE + label.PADDING)
|
iconSize := float64(d2target.MAX_ICON_SIZE + label.PADDING)
|
||||||
|
|
@ -453,7 +453,7 @@ func (edge *Edge) TraceToShape(points []*geo.Point, startIndex, endIndex int) (n
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if !overlapsOutsideLabel && edge.Src.Icon != nil && !srcShape.Is(shape.IMAGE_TYPE) {
|
if !overlapsOutsideLabel && edge.Src.HasIcon() {
|
||||||
// assumes IconPosition is set if there is an Icon
|
// assumes IconPosition is set if there is an Icon
|
||||||
iconPosition := label.FromString(*edge.Src.IconPosition)
|
iconPosition := label.FromString(*edge.Src.IconPosition)
|
||||||
if iconPosition.IsOutside() {
|
if iconPosition.IsOutside() {
|
||||||
|
|
@ -535,7 +535,7 @@ func (edge *Edge) TraceToShape(points []*geo.Point, startIndex, endIndex int) (n
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if !overlapsOutsideLabel && edge.Dst.Icon != nil && !dstShape.Is(shape.IMAGE_TYPE) {
|
if !overlapsOutsideLabel && edge.Dst.HasIcon() {
|
||||||
// assumes IconPosition is set if there is an Icon
|
// assumes IconPosition is set if there is an Icon
|
||||||
iconPosition := label.FromString(*edge.Dst.IconPosition)
|
iconPosition := label.FromString(*edge.Dst.IconPosition)
|
||||||
if iconPosition.IsOutside() {
|
if iconPosition.IsOutside() {
|
||||||
|
|
|
||||||
|
|
@ -1351,7 +1351,7 @@ func fitPadding(obj *d2graph.Object) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if obj.Icon != nil && shapeType != shape.IMAGE_TYPE && obj.IconPosition != nil {
|
if obj.HasIcon() && obj.IconPosition != nil {
|
||||||
iconPosition = label.FromString(*obj.IconPosition)
|
iconPosition = label.FromString(*obj.IconPosition)
|
||||||
switch iconPosition {
|
switch iconPosition {
|
||||||
case label.InsideTopLeft, label.InsideTopCenter, label.InsideTopRight,
|
case label.InsideTopLeft, label.InsideTopCenter, label.InsideTopRight,
|
||||||
|
|
@ -1386,7 +1386,7 @@ func fitPadding(obj *d2graph.Object) {
|
||||||
innerBoxes = append(innerBoxes, *childLabelBox)
|
innerBoxes = append(innerBoxes, *childLabelBox)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if child.Icon != nil && child.Shape.Value != d2target.ShapeImage && child.IconPosition != nil {
|
if child.HasIcon() && child.IconPosition != nil {
|
||||||
childIconPosition = label.FromString(*child.IconPosition)
|
childIconPosition = label.FromString(*child.IconPosition)
|
||||||
if childIconPosition.IsOutside() {
|
if childIconPosition.IsOutside() {
|
||||||
childIconTL := child.GetIconTopLeft()
|
childIconTL := child.GetIconTopLeft()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue