mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-20 07:31:30 -07:00
Untangle: allow frontends to alter some dimensions.
This change to Untangle allows for custom frontends to optionally define their own CIRCLE_RADIUS and DRAG_THRESHOLD parameters. Rationale: The hardcoded values provided here (specifically a 6px circle radius) is far too small for many modern pixel-dense devices, requiring frontends to duplicate files locally to fix. Adding #ifndef conditionals around these two values allow them to be configured by the frontend without the need to fork the files. The changes here are what I made to support my custom iOS frontend (Puzzles Reloaded) and work well.
This commit is contained in:

committed by
Simon Tatham

parent
8e83f39eb9
commit
5e7400403c
10
untangle.c
10
untangle.c
@ -40,8 +40,14 @@
|
||||
#include "puzzles.h"
|
||||
#include "tree234.h"
|
||||
|
||||
#define CIRCLE_RADIUS 6
|
||||
#define DRAG_THRESHOLD (CIRCLE_RADIUS * 2)
|
||||
#ifndef CIRCLE_RADIUS
|
||||
# define CIRCLE_RADIUS 6
|
||||
#endif
|
||||
|
||||
#ifndef DRAG_THRESHOLD
|
||||
# define DRAG_THRESHOLD (CIRCLE_RADIUS * 2)
|
||||
#endif
|
||||
|
||||
#define PREFERRED_TILESIZE 64
|
||||
|
||||
#define FLASH_TIME 0.30F
|
||||
|
Reference in New Issue
Block a user