diff --git a/core/base/Node.cpp b/core/base/Node.cpp index 197b91cf..1ff2be8e 100644 --- a/core/base/Node.cpp +++ b/core/base/Node.cpp @@ -43,7 +43,6 @@ namespace easy2d : visible_(true) , parent_(nullptr) , hash_name_(0) - , clip_enabled_(false) , dirty_sort_(false) , dirty_transform_(false) , order_(0) @@ -68,15 +67,10 @@ namespace easy2d if (!visible_) return; - auto graphics = devices::Graphics::Instance(); - - if (clip_enabled_) - { - graphics->PushClip(final_matrix_, transform_.size); - } - UpdateTransform(); + auto graphics = devices::Graphics::Instance(); + if (children_.IsEmpty()) { graphics->SetTransform(final_matrix_); @@ -118,11 +112,6 @@ namespace easy2d child->Visit(); } } - - if (clip_enabled_) - { - graphics->PopClip(); - } } void Node::Update(Duration const& dt) @@ -424,11 +413,6 @@ namespace easy2d dirty_transform_ = true; } - void Node::SetClipEnabled(bool enabled) - { - clip_enabled_ = enabled; - } - void Node::SetBorderColor(Color const& color) { border_color_ = color; diff --git a/core/base/Node.h b/core/base/Node.h index 95f5cced..0490013e 100644 --- a/core/base/Node.h +++ b/core/base/Node.h @@ -256,11 +256,6 @@ namespace easy2d const Size & size ); - // 启用或关闭渲染区域裁剪 - void SetClipEnabled( - bool enabled - ); - // 设置节点边缘颜色 void SetBorderColor( const Color& color @@ -358,7 +353,6 @@ namespace easy2d float opacity_; int order_; bool visible_; - bool clip_enabled_; bool dirty_sort_; bool dirty_transform_; Node* parent_;