simon-git: puzzles (main): Ben Harris

Commits to Tartarus hosted VCS tartarus-commits at lists.tartarus.org
Mon Apr 24 22:35:25 BST 2023


TL;DR:
  42cc7f6 Correct a comment in Pattern's clue-drawing code
  fcf1d27 Pattern: switch to small font when there are many row clues
  bbbbc8b Pattern: Reduce row clue spacing if there are lots of them

Repository:     https://git.tartarus.org/simon/puzzles.git
On the web:     https://git.tartarus.org/?p=simon/puzzles.git
Branch updated: main
Committer:      Ben Harris <bjh21 at bjh21.me.uk>
Date:           2023-04-24 22:35:25

commit 42cc7f6cb0bfb99255e94c86e3c155bc1c9fd0e1
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=42cc7f6cb0bfb99255e94c86e3c155bc1c9fd0e1;hp=20d424bf1bef4c1ed249ec3c72a859deb926e207
Author: Ben Harris <bjh21 at bjh21.me.uk>
Date:   Mon Apr 24 21:45:02 2023 +0100

    Correct a comment in Pattern's clue-drawing code

 pattern.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

commit fcf1d274c3f512e6f70cba71832e0ecc97b656d3
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=fcf1d274c3f512e6f70cba71832e0ecc97b656d3;hp=42cc7f6cb0bfb99255e94c86e3c155bc1c9fd0e1
Author: Ben Harris <bjh21 at bjh21.me.uk>
Date:   Mon Apr 24 22:12:30 2023 +0100

    Pattern: switch to small font when there are many row clues
    
    If you have a particularly large number of clues in a row, they can
    end up falling off the left edge of the window.  This used not to be a
    problem because the rendering code would squash them closer together
    if necessary.  But then I switched to drawing them all as a single
    string (so that two-digit row clues would get enough space with a
    large font) and that broke the old mechanism.
    
    Now we detect if there are enough clues that our conservative guess at
    the string length looks like overflowing in the big font, and switch
    to the small one if necessary.  If we had a drawing call to measure a
    string then we could be cleverer about this, but we don't.
    
    This problem can be demonstrated with "7x1:1//1//1//1/1.1.1.1" in the
    GTK port with the fonts my laptop has.
    
    I think overflow can still occur even with a small font, so once I've
    demonstrated that I'll try to fix it.

 pattern.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

commit bbbbc8b22bae0aa15b48273f763b0e215df0c7af
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=bbbbc8b22bae0aa15b48273f763b0e215df0c7af;hp=fcf1d274c3f512e6f70cba71832e0ecc97b656d3
Author: Ben Harris <bjh21 at bjh21.me.uk>
Date:   Mon Apr 24 22:25:12 2023 +0100

    Pattern: Reduce row clue spacing if there are lots of them
    
    Normally, we put two spaces between row clues, but if there are a lot
    then even with a smaller font size they might overflow the left edge
    of the window.  To compensate, go down to one space between clues
    instead of two if there are a lot of them.  On my laptop the GTK build
    demonstrates overflow with "13x1:1//1//1//1//1//1//1/1.1.1.1.1.1.1".

 pattern.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)



More information about the tartarus-commits mailing list