| 154 | } |
| 155 | |
| 156 | void TextAtlas::labelAtlasScaleChangedWithSize() |
| 157 | { |
| 158 | if (_ignoreSize) |
| 159 | { |
| 160 | _labelAtlasRenderer->setScale(1.0f); |
| 161 | } |
| 162 | else |
| 163 | { |
| 164 | Vec2 textureSize = _labelAtlasRenderer->getContentSize(); |
| 165 | if (textureSize.width <= 0.0f || textureSize.height <= 0.0f) |
| 166 | { |
| 167 | _labelAtlasRenderer->setScale(1.0f); |
| 168 | return; |
| 169 | } |
| 170 | float scaleX = _contentSize.width / textureSize.width; |
| 171 | float scaleY = _contentSize.height / textureSize.height; |
| 172 | _labelAtlasRenderer->setScaleX(scaleX); |
| 173 | _labelAtlasRenderer->setScaleY(scaleY); |
| 174 | } |
| 175 | _labelAtlasRenderer->setPosition(_contentSize.width / 2.0f, _contentSize.height / 2.0f); |
| 176 | } |
| 177 | |
| 178 | std::string TextAtlas::getDescription() const |
| 179 | { |
nothing calls this directly
no test coverage detected