From 393d35454d39545e1414afcef2773db9ed55513b Mon Sep 17 00:00:00 2001 From: XANTRONIX Development Date: Sun, 9 Jun 2019 17:05:18 -0500 Subject: [PATCH] Always scale gauge cluster to appropriate 32:15 aspect ratio --- src/cluster.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/cluster.c b/src/cluster.c index e491af7..2184ccd 100644 --- a/src/cluster.c +++ b/src/cluster.c @@ -10,6 +10,15 @@ hexagram_cluster *hexagram_cluster_new(double width, double height) { goto error_malloc_cluster; } + /* + * Ensure correct cluster aspect ratio + */ + if (width / height > 32.0 / 15.0) { + width = height * (32.0 / 15.0); + } else { + height = width * (15.0 / 32.0); + } + hexagram_tacho_init(&cluster->tacho, width * 0.2, height * 0.5,