From 71b5c50b8594814f2e34e485aa15639390ac9844 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Sun, 24 Oct 2021 14:17:43 +0200 Subject: [PATCH] Made the SliderComponent width consistent across different screen aspect ratios. --- es-core/src/components/SliderComponent.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/es-core/src/components/SliderComponent.cpp b/es-core/src/components/SliderComponent.cpp index 07eb7d36c..77f837529 100644 --- a/es-core/src/components/SliderComponent.cpp +++ b/es-core/src/components/SliderComponent.cpp @@ -8,6 +8,7 @@ #include "components/SliderComponent.h" +#include "Window.h" #include "resources/Font.h" #define MOVE_REPEAT_DELAY 500 @@ -32,7 +33,7 @@ SliderComponent::SliderComponent( mKnob.setOrigin(0.5f, 0.5f); 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)