| 146 | } |
| 147 | |
| 148 | void textDrawInBox(const char* text, int orientation, float scaleX, float scaleY, float baseline, float left, float right) |
| 149 | { |
| 150 | float bwidth = right-left; |
| 151 | float twidth = scaleX*textCalcWidth(text); |
| 152 | if (twidth > bwidth) |
| 153 | { |
| 154 | scaleX *= bwidth / twidth; |
| 155 | twidth = bwidth; |
| 156 | } |
| 157 | float x; |
| 158 | if (orientation < 0) |
| 159 | x = left; |
| 160 | else if (orientation > 0) |
| 161 | x = floorf(right-twidth); |
| 162 | else |
| 163 | x = left + floorf((bwidth-twidth)/2); |
| 164 | textDraw(x, baseline, scaleX, scaleY, true, text); |
| 165 | } |
no test coverage detected