~ruther/CTU-FEE-B0B35APO-Semestral-project

ref: 7aa0ada94624cf7cf1d81d2b5d0d7d43770b5757 CTU-FEE-B0B35APO-Semestral-project/lib-gui/src/gui_component_line.c -rw-r--r-- 862 bytes
7aa0ada9 — Rutherther chore: fix image in readme 1 year, 10 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include "gui_component_line.h"
#include "display_utils.h"
#include "gui.h"
#include "renderer.h"

component_t gui_line_create(const display_pixel_t *color, int16_t x, int16_t y,
                            int16_t w, int16_t h) {
  component_t line = gui_component_create(x, y, w, h, gui_line_render, gui_line_update);
  line.state = (void*)color;

  return line;
}

void gui_line_render(container_t *container, component_t *component,
                     gui_t *gui) {
  if (gui_is_component_visible(gui, container, component)) {
    renderer_render_border(gui->renderer, component->x, component->y, component->width,
                           component->height,
                           *(display_pixel_t *)component->state);
  }
}

void gui_line_update(container_t *container, component_t *component,
                     gui_t *gui) {
  // do nothing
}
Do not follow this link