Skip to content

Commit

Permalink
VerticalLayout && VHorizontalLayout _contentRect calc
Browse files Browse the repository at this point in the history
  • Loading branch information
fxliang committed Jan 13, 2024
1 parent 65c12e7 commit 163793c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 15 deletions.
12 changes: 2 additions & 10 deletions WeaselUI/VHorizontalLayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,11 +216,7 @@ void VHorizontalLayout::DoLayout(CDCHandle dc, PDWR pDWR )
_PrepareRoundInfo(dc);

// truely draw content size calculation
int deflatex = offsetX - _style.border / 2;
int deflatey = offsetY - _style.border / 2;
_contentRect.DeflateRect(deflatex, deflatey);
// eliminate the 1 pixel gap when border width odd and padding equal to margin
if (_style.border % 2 == 0) _contentRect.DeflateRect(1, 1);
_contentRect.DeflateRect(offsetX, offsetY);
}

void VHorizontalLayout::DoLayoutWithWrap(CDCHandle dc, PDWR pDWR)
Expand Down Expand Up @@ -538,10 +534,6 @@ void VHorizontalLayout::DoLayoutWithWrap(CDCHandle dc, PDWR pDWR)
}

// truely draw content size calculation
int deflatex = offsetX - _style.border / 2;
int deflatey = offsetY - _style.border / 2;
_contentRect.DeflateRect(deflatex, deflatey);
// eliminate the 1 pixel gap when border width odd and padding equal to margin
if (_style.border % 2 == 0) _contentRect.DeflateRect(1, 1);
_contentRect.DeflateRect(offsetX, offsetY);
}

6 changes: 1 addition & 5 deletions WeaselUI/VerticalLayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,5 @@ void weasel::VerticalLayout::DoLayout(CDCHandle dc, PDWR pDWR)
_PrepareRoundInfo(dc);

// truely draw content size calculation
int deflatex = offsetX - _style.border / 2;
int deflatey = offsetY - _style.border / 2;
_contentRect.DeflateRect(deflatex, deflatey);
// eliminate the 1 pixel gap when border width odd and padding equal to margin
if (_style.border % 2 == 0) _contentRect.DeflateRect(1, 1);
_contentRect.DeflateRect(offsetX, offsetY);
}

0 comments on commit 163793c

Please sign in to comment.