| 674 | |
| 675 | void Layer::addAnimation(const String& key, const Ref<IAnimation>& animation) { |
| 676 | removeAnimation(key); |
| 677 | { |
| 678 | (*_animations.writeAccess())[key] = animation; |
| 679 | } |
| 680 | scheduleProcessAnimationsIfNeeded(); |
| 681 | } |
| 682 | |
| 683 | void Layer::removeAnimation(const String& key) { |
| 684 | Ref<IAnimation> animation; |
| 685 | { |
| 686 | auto animations = _animations.writeAccess(); |
| 687 | const auto& it = animations->find(key); |
| 688 | if (it != animations->end()) { |
| 689 | animation = std::move(it->second); |
| 690 | animations->erase(it); |
| 691 | } |
| 692 | } |
| 693 |
no test coverage detected