| 196 | } |
| 197 | |
| 198 | void EditBox::loadTextureNormal(std::string_view normal, TextureResType texType) |
| 199 | { |
| 200 | _normalFileName = normal; |
| 201 | _normalTexType = texType; |
| 202 | bool textureLoaded = true; |
| 203 | if (normal.empty()) |
| 204 | { |
| 205 | _normalRenderer->resetRender(); |
| 206 | textureLoaded = false; |
| 207 | } |
| 208 | else |
| 209 | { |
| 210 | switch (texType) |
| 211 | { |
| 212 | case TextureResType::LOCAL: |
| 213 | _normalRenderer->initWithFile(normal); |
| 214 | break; |
| 215 | case TextureResType::PLIST: |
| 216 | _normalRenderer->initWithSpriteFrameName(normal); |
| 217 | break; |
| 218 | default: |
| 219 | break; |
| 220 | } |
| 221 | } |
| 222 | // FIXME: https://github.com/cocos2d/cocos2d-x/issues/12249 |
| 223 | if (!_ignoreSize && _customSize.equals(Vec2::ZERO)) |
| 224 | { |
| 225 | _customSize = _normalRenderer->getContentSize(); |
| 226 | } |
| 227 | this->setupNormalTexture(textureLoaded); |
| 228 | } |
| 229 | |
| 230 | void EditBox::setupNormalTexture(bool textureLoaded) |
| 231 | { |
nothing calls this directly
no test coverage detected