MCPcopy Create free account
hub / github.com/BernardoGiordano/Checkpoint / fitScale

Method fitScale

3ds/source/textpool.cpp:198–205  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

196}
197
198float TextPool::fitScale(const std::string& s, float maxWidth, float scale, float minScale) const
199{
200 const float w = StringUtils::textWidth(s, scale);
201 if (w <= maxWidth || w <= 0.0f) {
202 return scale;
203 }
204 return std::max(scale * maxWidth / w, minScale);
205}
206
207std::string TextPool::truncate(const std::string& s, float maxWidth, float scale) const
208{

Callers 1

drawMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected