Skip to content

Commit

Permalink
Fix checkbox font clipping (kallisti5#126)
Browse files Browse the repository at this point in the history
* Use const in more places

* Revert "Use const in more places"

This reverts commit 125b4aa.

* Fixed checkbox widgets would clip the font height

At least in some cases (with a font size of 15 that I tested), the font height was clipped due to the height of the checkbox being smaller.
Adding 2 pixels of padding in the height seems to fix that.
  • Loading branch information
midwan authored Nov 9, 2024
1 parent 36b9f9c commit 1db4b1b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/widgets/checkbox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,8 @@ namespace gcn
{
const int height = getFont()->getHeight();

setHeight(height);
// Add two pixels to avoid font clipping
setHeight(height + 2);
setWidth(getFont()->getWidth(mCaption) + height + height / 2);
}

Expand Down

0 comments on commit 1db4b1b

Please sign in to comment.