svx/source/tbxctrls/tbcontrl.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
New commits: commit adb3ba5432af64fe5c65c766ea78630ac96b6448 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Wed Dec 1 12:54:53 2021 +0000 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Thu Dec 2 20:21:53 2021 +0100 use smaller squares for smaller checker patterns Change-Id: Ib46b0906a0adf52f3806b269976ad15d280a28e7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126180 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index 04ae3e0ec4fa..130efa0b9122 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -4032,7 +4032,9 @@ void ColorListBox::ShowPreview(const NamedColor &rColor) { const Color aW(COL_WHITE); const Color aG(0xef, 0xef, 0xef); - xDevice->DrawCheckered(aRect.TopLeft(), aRect.GetSize(), 8, aW, aG); + int nMinDim = std::min(aImageSize.Width(), aImageSize.Height()) + 1; + int nCheckSize = nMinDim / 3; + xDevice->DrawCheckered(aRect.TopLeft(), aRect.GetSize(), std::min(nCheckSize, 8), aW, aG); xDevice->SetFillColor(); } else