Damage the whole node when animating slide

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
Šimon Brandner 2024-06-09 17:01:32 +02:00
parent 968cadf663
commit 11fcce5780
No known key found for this signature in database
GPG key ID: BB126BDA1FFBF42B
2 changed files with 14 additions and 8 deletions

View file

@ -273,12 +273,6 @@ void Hy3TabBar::tick() {
if (this->entries.empty()) this->destroy = true; if (this->entries.empty()) this->destroy = true;
} }
void Hy3TabBar::damage() {
auto pos = this->entries.front().node.position;
auto box = CBox {pos.x, pos.y, this->size.x, this->size.y};
g_pHyprRenderer->damageBox(&box);
}
void Hy3TabBar::updateNodeList(std::list<Hy3Node*>& nodes) { void Hy3TabBar::updateNodeList(std::list<Hy3Node*>& nodes) {
std::list<std::list<Hy3TabBarEntry>::iterator> removed_entries; std::list<std::list<Hy3TabBarEntry>::iterator> removed_entries;
@ -415,7 +409,17 @@ Hy3TabGroup::Hy3TabGroup(Hy3Node& node) {
this->size.warp(); this->size.warp();
} }
void Hy3TabGroup::damage() {
auto pos = this->node->position;
auto size = this->node->size;
auto box = CBox {pos.x, pos.y, size.x, size.y};
g_pHyprRenderer->damageBox(&box);
}
void Hy3TabGroup::updateWithGroup(Hy3Node& node, bool warp) { void Hy3TabGroup::updateWithGroup(Hy3Node& node, bool warp) {
this->node = &node;
static const auto gaps_in = ConfigValue<Hyprlang::CUSTOMTYPE, CCssGapData>("general:gaps_in"); static const auto gaps_in = ConfigValue<Hyprlang::CUSTOMTYPE, CCssGapData>("general:gaps_in");
static const auto gaps_out = ConfigValue<Hyprlang::CUSTOMTYPE, CCssGapData>("general:gaps_out"); static const auto gaps_out = ConfigValue<Hyprlang::CUSTOMTYPE, CCssGapData>("general:gaps_out");
static const auto bar_height = ConfigValue<Hyprlang::INT>("plugin:hy3:tabs:height"); static const auto bar_height = ConfigValue<Hyprlang::INT>("plugin:hy3:tabs:height");
@ -463,7 +467,7 @@ void Hy3TabGroup::tick() {
} }
if (this->workspace->m_vRenderOffset.isBeingAnimated()) { if (this->workspace->m_vRenderOffset.isBeingAnimated()) {
this->bar.damage(); this->damage();
} }
} }

View file

@ -67,7 +67,6 @@ public:
Hy3TabBar(); Hy3TabBar();
void beginDestroy(); void beginDestroy();
void damage();
void tick(); void tick();
void updateNodeList(std::list<Hy3Node*>& nodes); void updateNodeList(std::list<Hy3Node*>& nodes);
void updateAnimations(bool warp = false); void updateAnimations(bool warp = false);
@ -106,6 +105,7 @@ private:
std::vector<PHLWINDOWREF> stencil_windows; std::vector<PHLWINDOWREF> stencil_windows;
Vector2D last_pos; Vector2D last_pos;
Vector2D last_size; Vector2D last_size;
Hy3Node* node;
Hy3TabGroup(); Hy3TabGroup();
@ -114,4 +114,6 @@ private:
// UB if node is not a group. // UB if node is not a group.
void updateStencilWindows(Hy3Node&); void updateStencilWindows(Hy3Node&);
void damage();
}; };