mirror of
https://github.com/pikvm/ustreamer.git
synced 2025-12-23 18:50:00 +00:00
frametext: improved proportions
This commit is contained in:
parent
2717248581
commit
5b18e29555
@ -121,9 +121,13 @@ void us_frametext_draw(us_frametext_s *ft, const char *text, uint width, uint he
|
||||
if (block_width == 0 || block_height == 0) {
|
||||
goto empty;
|
||||
}
|
||||
uint scale_x = frame->width / block_width / 2;
|
||||
|
||||
// Ширина текста должна быть от 75%, до половины экрана, в зависимости от длины
|
||||
const float div_x = US_MAX(US_MIN((100 / block_width * 2), 2.0), 1.5);
|
||||
|
||||
uint scale_x = frame->width / block_width / div_x;
|
||||
uint scale_y = frame->height / block_height / 3;
|
||||
if (scale_x < scale_y / 1.5) {
|
||||
if (scale_x < scale_y / 1.5) { // Keep proportions
|
||||
scale_y = scale_x * 1.5;
|
||||
} else if (scale_y < scale_x * 1.5) {
|
||||
scale_x = scale_y / 1.5;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user