Skip to content

Commit

Permalink
fix issue 2 for HorizontalLayout
Browse files Browse the repository at this point in the history
  • Loading branch information
fxliang committed Jan 12, 2024
1 parent fb80f61 commit 65c12e7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
6 changes: 1 addition & 5 deletions WeaselUI/HorizontalLayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,5 @@ void HorizontalLayout::DoLayout(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);
}
3 changes: 1 addition & 2 deletions WeaselUI/WeaselPanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -782,8 +782,7 @@ void WeaselPanel::DoPaint(CDCHandle dc)
// background and candidates back, hilite back drawing start
if ((!m_ctx.empty() && !m_style.inline_preedit) || (m_style.inline_preedit && (m_candidateCount || !m_ctx.aux.empty() ))) {
CRect backrc = m_layout->GetContentRect();
if (!m_style.border)
backrc.InflateRect(1,1);
//if (!m_style.border) backrc.InflateRect(1,1);
_HighlightText(memDC, backrc, m_style.back_color, m_style.shadow_color, m_style.round_corner_ex, BackType::BACKGROUND, IsToRoundStruct(), m_style.border_color);
}
if (!m_ctx.aux.str.empty())
Expand Down

0 comments on commit 65c12e7

Please sign in to comment.