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:
Kyle Swarner
2024-11-21 11:55:38 -05:00
committed by Simon Tatham
parent 8e83f39eb9
commit 5e7400403c

View File

@ -40,8 +40,14 @@
#include "puzzles.h" #include "puzzles.h"
#include "tree234.h" #include "tree234.h"
#ifndef CIRCLE_RADIUS
# define CIRCLE_RADIUS 6 # define CIRCLE_RADIUS 6
#endif
#ifndef DRAG_THRESHOLD
# define DRAG_THRESHOLD (CIRCLE_RADIUS * 2) # define DRAG_THRESHOLD (CIRCLE_RADIUS * 2)
#endif
#define PREFERRED_TILESIZE 64 #define PREFERRED_TILESIZE 64
#define FLASH_TIME 0.30F #define FLASH_TIME 0.30F