| 4 | { |
| 5 | |
| 6 | Vector2i calcTextureRes( int bufferSize, int maxTextWidth ) |
| 7 | { |
| 8 | if ( bufferSize <= maxTextWidth ) |
| 9 | return { bufferSize, 1 }; |
| 10 | int space = maxTextWidth - ( bufferSize % maxTextWidth ); |
| 11 | int height = ( bufferSize + maxTextWidth - 1 ) / maxTextWidth; |
| 12 | if ( space == maxTextWidth ) |
| 13 | return { maxTextWidth, height }; |
| 14 | int shift = space / height; |
| 15 | return { maxTextWidth - shift, height }; |
| 16 | } |
| 17 | |
| 18 | } |
no outgoing calls
no test coverage detected