File tree Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Original file line number Diff line number Diff line change @@ -108,7 +108,7 @@ func (l *Legend) Draw(c draw.Canvas) {
108
108
109
109
descent := sty .FontExtents ().Descent
110
110
enth := l .entryHeight ()
111
- y := c .Max .Y - enth
111
+ y := c .Max .Y - enth - descent
112
112
if ! l .Top {
113
113
y = c .Min .Y + (enth + l .Padding )* (vg .Length (len (l .entries ))- 1 )
114
114
}
@@ -173,12 +173,8 @@ func (l *Legend) Rectangle(c draw.Canvas) vg.Rectangle {
173
173
// entryHeight returns the height of the tallest legend
174
174
// entry text.
175
175
func (l * Legend ) entryHeight () (height vg.Length ) {
176
- var (
177
- ext = l .TextStyle .FontExtents ()
178
- desc = ext .Height - ext .Ascent // descent + linegap
179
- )
180
176
for _ , e := range l .entries {
181
- if h := l .TextStyle .Rectangle (e .text ).Max .Y + desc ; h > height {
177
+ if h := l .TextStyle .Rectangle (e .text ).Max .Y ; h > height {
182
178
height = h
183
179
}
184
180
}
You can’t perform that action at this time.
0 commit comments