Tried making values equal to TS project.
This commit is contained in:
parent
75c0dee349
commit
5cfc71f271
1 changed files with 16 additions and 11 deletions
|
|
@ -115,8 +115,8 @@ func arrowheadDimensions(arrowhead d2target.Arrowhead, strokeWidth float64) (wid
|
|||
widthMultiplier = 11
|
||||
heightMultiplier = 9
|
||||
case d2target.FilledCircleArrowhead, d2target.CircleArrowhead:
|
||||
widthMultiplier = 14
|
||||
heightMultiplier = 14
|
||||
widthMultiplier = 12
|
||||
heightMultiplier = 12
|
||||
case d2target.CfOne, d2target.CfMany, d2target.CfOneRequired, d2target.CfManyRequired:
|
||||
widthMultiplier = 14
|
||||
heightMultiplier = 15
|
||||
|
|
@ -230,16 +230,19 @@ func arrowheadMarker(isTarget bool, id string, connection d2target.Connection) s
|
|||
case d2target.FilledCircleArrowhead:
|
||||
attrs := fmt.Sprintf(`class="connection" fill="%s" stroke-width="%d"`, connection.Stroke, connection.StrokeWidth)
|
||||
if isTarget {
|
||||
|
||||
path = fmt.Sprintf(`<circle %s clip-path="circle()" cx="%f" cy="%f" r="%f"/>`,
|
||||
attrs,
|
||||
width-10.3+strokeWidth/3, height/2,
|
||||
width/2.9,
|
||||
3.2*4+2.2,
|
||||
(height/1.6)/strokeWidth*2,
|
||||
(width/3.2)/strokeWidth*2,
|
||||
)
|
||||
} else {
|
||||
path = fmt.Sprintf(`<circle %s clip-path="circle()" cx="%f" cy="%f" r="%f"/>`,
|
||||
attrs,
|
||||
width-19+strokeWidth/3, height/2,
|
||||
width/2.9,
|
||||
3.2*4+2.2,
|
||||
(height/1.6)/strokeWidth*2,
|
||||
(width/3.2)/strokeWidth*2,
|
||||
)
|
||||
}
|
||||
case d2target.CircleArrowhead:
|
||||
|
|
@ -247,14 +250,16 @@ func arrowheadMarker(isTarget bool, id string, connection d2target.Connection) s
|
|||
if isTarget {
|
||||
path = fmt.Sprintf(`<circle %s cx="%f" cy="%f" r="%f"/>`,
|
||||
attrs,
|
||||
width/2+3.6+strokeWidth/3, height/2,
|
||||
width/3.2,
|
||||
3.2*4+2.2,
|
||||
(height/1.6)/strokeWidth*2,
|
||||
(width/3.2)/strokeWidth*2,
|
||||
)
|
||||
} else {
|
||||
path = fmt.Sprintf(`<circle %s cx="%f" cy="%f" r="%f"/>`,
|
||||
attrs,
|
||||
width/2-4.9+strokeWidth/3, height/2,
|
||||
width/3.2,
|
||||
3.2*4+2.2,
|
||||
(height/1.6)/strokeWidth*2,
|
||||
(width/3.2)/strokeWidth*2,
|
||||
)
|
||||
}
|
||||
|
||||
|
|
@ -304,7 +309,7 @@ func arrowheadMarker(isTarget bool, id string, connection d2target.Connection) s
|
|||
var refX float64
|
||||
refY := height / 2
|
||||
switch arrowhead {
|
||||
case d2target.DiamondArrowhead:
|
||||
case d2target.DiamondArrowhead, d2target.CircleArrowhead:
|
||||
if isTarget {
|
||||
refX = width - 0.6*strokeWidth
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in a new issue