DragonBonesCPP icon indicating copy to clipboard operation
DragonBonesCPP copied to clipboard

Bone Slot class setVisible change suggest

Open namuda opened this issue 5 years ago • 0 comments

void Bone::setVisible(bool value) { if (_visible == value) { return; } _visible = value; for (const auto & slot : _armature->getSlots()) { if (slot->getParent() == this) { slot->_updateVisible(); } } }

void Slot::setVisible(bool value) { if (_visible == value) { return; } _visible = value; _updateVisible(); }

void CCSlot::_updateVisible() { _renderDisplay->setVisible(_parent->getVisible()); // Only the visible state of the bone is used. }

-- suggest Bone class void Bone::setVisible(bool value) { if (_visible == value) { return; } _visible = value; for (const auto & slot : _armature->getSlots()) { if (slot->getParent() == this) { slot->setVisible(_visible); //Change:Apply to bone sub-slot visible state slot->_updateVisible(); } } }

CCSlot class void CCSlot::_updateVisible() { _renderDisplay->setVisible(getVisible());//Change:Apply slot visible state }

The existing setVisible() function can not apply the visible state on a slot by itself. I hope you can use both the slot and the visible state of the bone. I would like to be able to use both the slot and bone visible states.

namuda avatar Aug 14 '18 07:08 namuda