Calculates the margin sizes and sets the class variables accordingly
()
| 2220 | |
| 2221 | /** Calculates the margin sizes and sets the class variables accordingly */ |
| 2222 | void makeMarginValues() { |
| 2223 | Font font = nonNullFont(pp.frame.getFont(), currentFont); |
| 2224 | float marginScale = 0.1f + 0.9f*font.getSize2D()/12f; |
| 2225 | if (marginScale < 0.7f) marginScale = 0.7f; |
| 2226 | if (marginScale > 2f) marginScale = 2f; |
| 2227 | int addHspace = (int)Tools.getNumberFromList(pp.frame.options, "addhspace="); //user-defined extra space |
| 2228 | int addVspace = (int)Tools.getNumberFromList(pp.frame.options, "addvspace="); |
| 2229 | leftMargin = sc(LEFT_MARGIN*marginScale + addHspace); |
| 2230 | rightMargin = sc(RIGHT_MARGIN*marginScale + addHspace); |
| 2231 | topMargin = sc(TOP_MARGIN*marginScale + addVspace); |
| 2232 | bottomMargin = sc(BOTTOM_MARGIN*marginScale + 2 + addVspace); |
| 2233 | if(pp != null && pp.xLabel != null && pp.xLabel.getFont() != null){ |
| 2234 | float numberSize = font.getSize2D(); |
| 2235 | float labelSize = pp.xLabel.getFont().getSize2D(); |
| 2236 | float extraHeight = 1.5f *(labelSize - numberSize); |
| 2237 | if(extraHeight > 0){ |
| 2238 | bottomMargin += sc(extraHeight); |
| 2239 | leftMargin += sc(extraHeight); |
| 2240 | } |
| 2241 | } |
| 2242 | } |
| 2243 | |
| 2244 | /** Calculate the actual range, major step interval and set variables for data <-> pixels scaling */ |
| 2245 | double[] makeRangeGetSteps() { |
no test coverage detected