diff options
author | B Stack <bgstack15@gmail.com> | 2021-02-02 11:44:31 -0500 |
---|---|---|
committer | B Stack <bgstack15@gmail.com> | 2021-02-02 11:44:31 -0500 |
commit | d299ddd2f27a437f0fc0cb49abdfd6dd8e3d94f8 (patch) | |
tree | 4d7c950512836f473a6a8cbb521c61e800db6584 /wx+/popup_dlg.cpp | |
parent | Merge branch '11.5' into 'master' (diff) | |
download | FreeFileSync-d299ddd2f27a437f0fc0cb49abdfd6dd8e3d94f8.tar.gz FreeFileSync-d299ddd2f27a437f0fc0cb49abdfd6dd8e3d94f8.tar.bz2 FreeFileSync-d299ddd2f27a437f0fc0cb49abdfd6dd8e3d94f8.zip |
add upstream 11.6
Diffstat (limited to 'wx+/popup_dlg.cpp')
-rw-r--r-- | wx+/popup_dlg.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/wx+/popup_dlg.cpp b/wx+/popup_dlg.cpp index 0a1ff2a0..88ed590b 100644 --- a/wx+/popup_dlg.cpp +++ b/wx+/popup_dlg.cpp @@ -5,6 +5,7 @@ // ***************************************************************************** #include "popup_dlg.h" +#include <zen/basic_math.h> #include <wx/app.h> #include <wx/display.h> #include "no_flicker.h" @@ -38,7 +39,7 @@ void setBestInitialSize(wxRichTextCtrl& ctrl, const wxString& text, wxSize maxSi { maxLineWidth = std::max(maxLineWidth, sz.x); - const int wrappedRows = numeric::integerDivideRoundUp(sz.x, maxSize.x - scrollbarWidth); //integer round up: consider line-wraps! + const int wrappedRows = numeric::intDivCeil(sz.x, maxSize.x - scrollbarWidth); //round up: consider line-wraps! rowCount += wrappedRows; rowHeight = std::max(rowHeight, sz.y); //all rows *should* have same height if (wrappedRows > 1) @@ -71,8 +72,8 @@ void setBestInitialSize(wxRichTextCtrl& ctrl, const wxString& text, wxSize maxSi const int extraHeight = 0; #endif int extraWidth = 0; - if (haveLineWrap) //compensate for trivial integerDivideRoundUp() not - extraWidth += ctrl.GetTextExtent(L"FreeFileSync").x / 2; //understanding line wrap algorithm + if (haveLineWrap) //compensate for trivial intDivCeil() not... + extraWidth += ctrl.GetTextExtent(L"FreeFileSync").x / 2; //...understanding line wrap algorithm const wxSize bestSize(std::min(maxLineWidth, maxSize.x) + extraWidth, std::min(rowCount * (rowHeight + rowGap) + extraHeight, maxSize.y)); |