summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-12-01 12:54:53 +0000
committerCaolán McNamara <caolanm@redhat.com>2021-12-02 20:21:53 +0100
commitadb3ba5432af64fe5c65c766ea78630ac96b6448 (patch)
tree438c8e4e850af882a431be831741536a86bd802d
parentf48a9cc5371bb5d318af929ad9f7157a8b3f88aa (diff)
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 <caolanm@redhat.com>
-rw-r--r--svx/source/tbxctrls/tbcontrl.cxx4
1 files changed, 3 insertions, 1 deletions
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