* @brief Returns a copy of the Scale9Sprite */
| 412 | * @brief Returns a copy of the Scale9Sprite |
| 413 | */ |
| 414 | void Scale9Sprite::copyTo(Scale9Sprite* copy) const |
| 415 | { |
| 416 | copy->initWithSpriteFrame(getSpriteFrame(), getCapInsets()); |
| 417 | |
| 418 | copy->setRenderingType(_renderingType); |
| 419 | copy->setScale9Enabled(isScale9Enabled()); |
| 420 | // setStretchEnabled after setScale9Enabled, fix issue: https://github.com/axmolengine/axmol/issues/491 |
| 421 | copy->setStretchEnabled(isStretchEnabled()); |
| 422 | copy->_isPatch9 = _isPatch9; |
| 423 | copy->_brightState = _brightState; |
| 424 | |
| 425 | // these properties should be part of Sprite::clone() (or Node::clone()) |
| 426 | // but cloning is not supported on those nodes |
| 427 | copy->setContentSize(getContentSize()); |
| 428 | copy->setPosition(getPosition()); |
| 429 | copy->setScale(getScaleX(), getScaleY()); |
| 430 | copy->setRotation(getRotation()); |
| 431 | copy->setRotationSkewX(getRotationSkewX()); |
| 432 | copy->setRotationSkewY(getRotationSkewY()); |
| 433 | copy->setColor(getColor()); |
| 434 | copy->setOpacity(getOpacity()); |
| 435 | copy->_originalContentSize = _originalContentSize; |
| 436 | } |
| 437 | |
| 438 | // (0,0) O = capInsets.origin |
| 439 | // v0---------------------- |
no test coverage detected