From 8439c0997631c3b2beee671fcec0f38457539836 Mon Sep 17 00:00:00 2001 From: Nomango <569629550@qq.com> Date: Sun, 22 Apr 2018 17:08:41 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A4=E6=96=AD=E8=8A=82=E7=82=B9=E6=98=AF?= =?UTF-8?q?=E5=90=A6=E7=A2=B0=E6=92=9E=E5=8F=8A=E7=82=B9=E6=98=AF=E5=90=A6?= =?UTF-8?q?=E5=9C=A8=E8=8A=82=E7=82=B9=E5=86=85=E6=97=B6=EF=BC=8C=E4=B8=8D?= =?UTF-8?q?=E5=86=8D=E5=88=A4=E6=96=AD=E5=85=B6=E5=AD=90=E8=8A=82=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/Node/Button.cpp | 10 +++++----- core/Node/Node.cpp | 16 ---------------- 2 files changed, 5 insertions(+), 21 deletions(-) diff --git a/core/Node/Button.cpp b/core/Node/Button.cpp index 83c64966..c0774320 100644 --- a/core/Node/Button.cpp +++ b/core/Node/Button.cpp @@ -1,7 +1,7 @@ #include "..\e2dnode.h" #include "..\e2dmanager.h" -#define SAFE_SETTER(pointer, func, ...) if (pointer) { pointer->##func(__VA_ARGS__); } +#define SAFE_SET(pointer, func, ...) if (pointer) { pointer->##func(__VA_ARGS__); } e2d::Button::Button() @@ -235,10 +235,10 @@ void e2d::Button::_setState(BTN_STATE state) void e2d::Button::_updateVisiable() { - SAFE_SETTER(m_pNormal, setVisiable, false); - SAFE_SETTER(m_pMouseover, setVisiable, false); - SAFE_SETTER(m_pSelected, setVisiable, false); - SAFE_SETTER(m_pDisabled, setVisiable, false); + SAFE_SET(m_pNormal, setVisiable, false); + SAFE_SET(m_pMouseover, setVisiable, false); + SAFE_SET(m_pSelected, setVisiable, false); + SAFE_SET(m_pDisabled, setVisiable, false); if (m_bEnable) { diff --git a/core/Node/Node.cpp b/core/Node/Node.cpp index ddd99210..14ddf0f7 100644 --- a/core/Node/Node.cpp +++ b/core/Node/Node.cpp @@ -948,11 +948,6 @@ bool e2d::Node::isPointIn(Point point) const return true; } - // 判断点是否在子节点内 - FOR_LOOP(child, m_vChildren) - if (child->isPointIn(point)) - return true; - return false; } @@ -1009,17 +1004,6 @@ bool e2d::Node::isIntersectWith(const Node * pNode) const } } - // 判断和其子节点是否相交 - FOR_LOOP(pNodeChild, pNode->m_vChildren) - if (this->isIntersectWith(pNodeChild)) - return true; - - // 判断子节点和其是否相交 - FOR_LOOP(child, m_vChildren) - if (child->isIntersectWith(pNode)) - return true; - - // 都不相交,返回 false return false; }