From b07165f154b405885925043d01bcd856be8e6474 Mon Sep 17 00:00:00 2001 From: Jack Zeal Date: Wed, 1 Apr 2026 19:43:20 -0700 Subject: [PATCH] Ensure we use all details of borders when caching them --- include/common/borderset.h | 1 + src/common/borderset.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/include/common/borderset.h b/include/common/borderset.h index 6b2a9602..b1906668 100644 --- a/include/common/borderset.h +++ b/include/common/borderset.h @@ -11,6 +11,7 @@ struct borderset { uint32_t id; // Base colour, but could be used as a tracking hash for images or whatever in the future int size; // width (since I suspect a 2px border scaled up to 20px might look weird) enum border_type type; // Single or double bevel + int bevelSize; // So we can disambiguate multiple possible designs cached together struct lab_data_buffer *top; struct lab_data_buffer *left; struct lab_data_buffer *right; diff --git a/src/common/borderset.c b/src/common/borderset.c index bae5c601..13826161 100644 --- a/src/common/borderset.c +++ b/src/common/borderset.c @@ -24,7 +24,7 @@ struct borderset * getBorders(uint32_t id, int size, enum border_type type, int } while (current != NULL) { - if (current->size == size && current->id == id && current->type == type) { + if (current->size == size && current->id == id && current->type == type && current->bevelSize == bevelSize) { return current; } last = current; @@ -50,6 +50,7 @@ struct borderset * createBuffer(uint32_t id, int size, enum border_type type, i newBorderset->id = id; newBorderset->size = size; newBorderset->type = type; + newBorderset->bevelSize = bevelSize; // Use ID as a AARRGGBB colour