Skip to content

Commit

Permalink
fix(flickering): fixed flickering when using divider
Browse files Browse the repository at this point in the history
  • Loading branch information
MurkyYT committed Aug 28, 2024
1 parent 3fd79c2 commit cb8917c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions MUI/MUI.h
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,8 @@ namespace MUI {
struct GridItem
{
friend class Grid;
public:
UIComponent* GetComponent() { return component; }
private:
int row;
int column;
Expand Down
2 changes: 0 additions & 2 deletions MUI/UIComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ namespace MUI
pos.x = pos.x - this->m_margin.right + this->m_margin.left;
pos.y = pos.y - this->m_margin.bottom + this->m_margin.top;
MoveWindow(this->handle, pos.x, pos.y, min(w,this->width), min(h,this->height), TRUE);
InvalidateRect(this->handle, NULL, FALSE);
UpdateWindow(this->handle);
}
void UIComponent::UpdateVerticalAligment(POINT& pos, int h,int y)
{
Expand Down
6 changes: 6 additions & 0 deletions MUI/Window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,12 @@ namespace MUI
window->m_grid->Reorder(window->m_hWnd);
for (std::shared_ptr<GridItem> itm : window->m_grid->GetItems())
window->m_grid->Reposition(itm.get());
for (std::shared_ptr<GridItem> itm : window->m_grid->GetItems())
{
InvalidateRect(itm->GetComponent()->handle, NULL, FALSE);
UpdateWindow(itm->GetComponent()->handle);
}

}
std::vector<std::shared_ptr<Divider>> dividers = window->m_grid->GetDividers();
for (std::shared_ptr<Divider> div : dividers)
Expand Down

0 comments on commit cb8917c

Please # to comment.