Skip to content

Commit 93381d8

Browse files
committed
Fixed slider timestamp font not being affected by font_scale.
1 parent a4c8328 commit 93381d8

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

‎src/slider.cpp‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@
2222

2323
PositionSlider::PositionSlider(float percent) {
2424
this->percent = percent;
25+
}
2526

26-
font = fontmanager.grab(gGourceSettings.font_file, 16);
27+
void PositionSlider::init() {
28+
font = fontmanager.grab(gGourceSettings.font_file, 16 * gGourceSettings.font_scale);
2729
font.dropShadow(true);
2830

2931
slidercol = vec3(1.0, 1.0, 1.0);
@@ -155,7 +157,8 @@ void PositionSlider::draw(float dt) {
155157
glColor4f(1.0, 1.0, 1.0, 1.0);
156158

157159
if(caption.size() && mouseover >= 0.0) {
158-
font.draw(std::min((double)display.width - capwidth - 1.0, std::max(1.0, mouseover - (capwidth/2.0))), bounds.min.y - 25.0, caption);
160+
int height_offset = 25 * gGourceSettings.font_scale;
161+
font.draw(std::min((double)display.width - capwidth - 1.0, std::max(1.0, mouseover - (capwidth/2.0))), bounds.min.y - height_offset, caption);
159162
}
160163

161164
}

‎src/slider.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ class PositionSlider {
4242
public:
4343
PositionSlider(float percent = 0.0f);
4444

45+
void init();
46+
4547
void setColour(vec3 col);
4648

4749
void setCaption(const std::string& cap);

0 commit comments

Comments
 (0)