| 2850 | } |
| 2851 | |
| 2852 | void LabelLayoutBaseTest::valueChanged(ax::Object* sender, ax::extension::Control::EventType controlEvent) |
| 2853 | { |
| 2854 | ControlStepper* pControl = (ControlStepper*)sender; |
| 2855 | // Change value of label. |
| 2856 | auto fontSizeLabel = (Label*)this->getChildByName("fontSize"); |
| 2857 | float fontSize = (float)pControl->getValue(); |
| 2858 | fontSizeLabel->setString(fmt::format("font size:{}", (int)fontSize)); |
| 2859 | |
| 2860 | if (_labelType == 0) |
| 2861 | { |
| 2862 | auto ttfConfig = _label->getTTFConfig(); |
| 2863 | ttfConfig.fontSize = fontSize; |
| 2864 | _label->setTTFConfig(ttfConfig); |
| 2865 | } |
| 2866 | else if (_labelType == 1) |
| 2867 | { |
| 2868 | _label->setBMFontSize(fontSize); |
| 2869 | } |
| 2870 | else if (_labelType == 2) |
| 2871 | { |
| 2872 | _label->setSystemFontSize(fontSize); |
| 2873 | } |
| 2874 | this->updateDrawNodeSize(_label->getContentSize()); |
| 2875 | |
| 2876 | // FIXME::When calling getLetter, the label Overflow feature will be invalid. |
| 2877 | // auto letterSprite = _label->getLetter(1); |
| 2878 | // auto moveBy = ScaleBy::create(1.0,2.0); |
| 2879 | // letterSprite->stopAllActions(); |
| 2880 | // letterSprite->runAction(Sequence::create(moveBy, moveBy->clone()->reverse(), nullptr )); |
| 2881 | // |
| 2882 | // AXLOGD("label line height = {}", _label->getLineHeight()); |
| 2883 | } |
| 2884 | |
| 2885 | void LabelLayoutBaseTest::onExit() |
| 2886 | { |
nothing calls this directly
no test coverage detected