|
1929 | 1929 | padding_x = Math.round(0.03*w/ncols), |
1930 | 1930 | padding_y = Math.round(0.03*h), |
1931 | 1931 | step_y = (h - 2*padding_y)/nrows, |
| 1932 | + font_size = 0.9*step_y, |
| 1933 | + max_font_size = 0, // not limited in the beggining |
1932 | 1934 | ph = this.pad_height(), |
1933 | 1935 | fsize, any_opt = false, i = -1; |
1934 | 1936 |
|
1935 | | - if (legend.fTextSize && (ph*legend.fTextSize > 2) && (ph*legend.fTextSize < step_y)) fsize = Math.round(ph*legend.fTextSize); |
| 1937 | + if (legend.fTextSize && (ph*legend.fTextSize > 2) && (ph*legend.fTextSize < font_size)) |
| 1938 | + font_size = max_font_size = Math.round(ph*legend.fTextSize); |
1936 | 1939 |
|
1937 | | - this.StartTextDrawing(legend.fTextFont, 0.9*step_y); |
| 1940 | + this.StartTextDrawing(legend.fTextFont, font_size, this.draw_g, max_font_size); |
1938 | 1941 |
|
1939 | 1942 | for (var ii = 0; ii < nlines; ++ii) { |
1940 | 1943 | var leg = legend.fPrimitives.arr[ii]; |
|
2016 | 2019 | else if (!any_opt) pos_x = x0 + padding_x; |
2017 | 2020 |
|
2018 | 2021 | if (leg.fLabel) |
2019 | | - this.DrawText({ align: "start", x: pos_x, y: pos_y, width: x0+column_width-pos_x-padding_x, height: step_y, text: leg.fLabel, color: tcolor, font_size: fsize }); |
| 2022 | + this.DrawText({ align: "start", x: pos_x, y: pos_y, width: x0+column_width-pos_x-padding_x, height: step_y, text: leg.fLabel, color: tcolor }); |
2020 | 2023 | } |
2021 | 2024 |
|
2022 | 2025 | // rescale after all entries are shown |
2023 | | - this.FinishTextDrawing(null, this.FinishPave); |
| 2026 | + this.FinishTextDrawing(this.draw_g, this.FinishPave); |
2024 | 2027 | } |
2025 | 2028 |
|
2026 | 2029 | TPavePainter.prototype.FillContextMenu = function(menu) { |
|
0 commit comments