Always scale gauge cluster to appropriate 32:15 aspect ratio
This commit is contained in:
parent
74ab4d1a5f
commit
393d35454d
1 changed files with 9 additions and 0 deletions
|
@ -10,6 +10,15 @@ hexagram_cluster *hexagram_cluster_new(double width, double height) {
|
||||||
goto error_malloc_cluster;
|
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,
|
hexagram_tacho_init(&cluster->tacho,
|
||||||
width * 0.2,
|
width * 0.2,
|
||||||
height * 0.5,
|
height * 0.5,
|
||||||
|
|
Loading…
Add table
Reference in a new issue