Made the SliderComponent width consistent across different screen aspect ratios.

This commit is contained in:
Leon Styhre 2021-10-24 14:17:43 +02:00
parent 593cfdbdd7
commit 71b5c50b85

View file

@ -8,6 +8,7 @@
#include "components/SliderComponent.h" #include "components/SliderComponent.h"
#include "Window.h"
#include "resources/Font.h" #include "resources/Font.h"
#define MOVE_REPEAT_DELAY 500 #define MOVE_REPEAT_DELAY 500
@ -32,7 +33,7 @@ SliderComponent::SliderComponent(
mKnob.setOrigin(0.5f, 0.5f); mKnob.setOrigin(0.5f, 0.5f);
mKnob.setImage(":/graphics/slider_knob.svg"); mKnob.setImage(":/graphics/slider_knob.svg");
setSize(Renderer::getScreenWidth() * 0.15f, Font::get(FONT_SIZE_MEDIUM)->getLetterHeight()); setSize(window->peekGui()->getSize().x * 0.26f, Font::get(FONT_SIZE_MEDIUM)->getLetterHeight());
} }
bool SliderComponent::input(InputConfig* config, Input input) bool SliderComponent::input(InputConfig* config, Input input)