fix: use fixed length for left stroked legend

The stroke length was just way too long, so I first tried to decrease the length by subtracting the padding from it, but it was not a big difference.
I ended up using a hardcoded value because it gave the best visual results on different resolutions.
This commit is contained in:
Rico 2022-02-08 03:47:05 +01:00
parent f0b283349e
commit 901d2bb313
No known key found for this signature in database
GPG key ID: 91F477359C5B7AD3

View file

@ -145,6 +145,7 @@ func LegendLineLeft(c *Chart, userDefaults ...Style) Renderable {
// DEFAULTS
lineTextGap := 5
lineLengthMinimum := 25
strokeLength := 17
var labels []string
var lines []Style
@ -215,7 +216,7 @@ func LegendLineLeft(c *Chart, userDefaults ...Style) Renderable {
ly := ty - th2
// Calculate line ending x coordinate
lx2 := lx + lineLengthMinimum - legendStyle.Padding.Left
lx2 := lx + strokeLength
r.SetStrokeColor(lines[x].GetStrokeColor())
r.SetStrokeWidth(lines[x].GetStrokeWidth())