diff options
author | B Stack <bgstack15@gmail.com> | 2021-02-02 21:49:34 +0000 |
---|---|---|
committer | B Stack <bgstack15@gmail.com> | 2021-02-02 21:49:34 +0000 |
commit | 26b8bd6eb07b78adad36049e03494a2931b231af (patch) | |
tree | 4d7c950512836f473a6a8cbb521c61e800db6584 /wx+/popup_dlg.cpp | |
parent | Merge branch '11.5' into 'master' (diff) | |
parent | add upstream 11.6 (diff) | |
download | FreeFileSync-26b8bd6eb07b78adad36049e03494a2931b231af.tar.gz FreeFileSync-26b8bd6eb07b78adad36049e03494a2931b231af.tar.bz2 FreeFileSync-26b8bd6eb07b78adad36049e03494a2931b231af.zip |
Merge branch '11.6' into 'master'11.6
add upstream 11.6
See merge request opensource-tracking/FreeFileSync!30
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)); |