From abc356a119cfdffbc8e7467faeead39824902018 Mon Sep 17 00:00:00 2001 From: rexim Date: Sun, 7 Jul 2019 01:36:31 +0700 Subject: [PATCH] (#931) Extract label_size --- src/game/level/level_editor/color_picker.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/game/level/level_editor/color_picker.c b/src/game/level/level_editor/color_picker.c index a02f6d93..d4bae4a4 100644 --- a/src/game/level/level_editor/color_picker.c +++ b/src/game/level/level_editor/color_picker.c @@ -70,6 +70,7 @@ int color_picker_render(const ColorPicker *color_picker, const Rect slider_rect = rect(0.0f, COLOR_SLIDER_HEIGHT * (float) (index + 1), COLOR_SLIDER_WIDTH, COLOR_SLIDER_HEIGHT); + const Point label_size = vec(2.5f, 2.5f); if (slider_render( &color_picker->sliders[index], @@ -81,10 +82,10 @@ int color_picker_render(const ColorPicker *color_picker, if (camera_render_text_screen( camera, slider_labels[index], - vec(2.5f, 2.5f), + label_size, COLOR_BLACK, vec(slider_rect.x + COLOR_SLIDER_WIDTH, - slider_rect.y + COLOR_SLIDER_HEIGHT * 0.5f - 2.5f * (float) FONT_CHAR_HEIGHT * 0.5f)) < 0) { + slider_rect.y + COLOR_SLIDER_HEIGHT * 0.5f - label_size.y * (float) FONT_CHAR_HEIGHT * 0.5f)) < 0) { return -1; } } -- 2.44.0