From adb3ba5432af64fe5c65c766ea78630ac96b6448 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 1 Dec 2021 12:54:53 +0000 Subject: use smaller squares for smaller checker patterns MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ib46b0906a0adf52f3806b269976ad15d280a28e7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126180 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- svx/source/tbxctrls/tbcontrl.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 -- cgit