summaryrefslogtreecommitdiff
path: root/lib/lvgl/src/draw/lv_draw_rect.c
diff options
context:
space:
mode:
authorjacqueline <me@jacqueline.id.au>2023-06-01 15:41:47 +1000
committerjacqueline <me@jacqueline.id.au>2023-06-01 15:41:47 +1000
commitdd27c3530432ea0b09f01e604bf577f31d8ef841 (patch)
treebbf86cf81a78f0ff0b07f31f1c390db473f26fd3 /lib/lvgl/src/draw/lv_draw_rect.c
parent6fd588e970470b15936187980829916d0dbe77bb (diff)
downloadtangara-fw-dd27c3530432ea0b09f01e604bf577f31d8ef841.tar.gz
convert lvgl from submodule to a plain old directory
Diffstat (limited to 'lib/lvgl/src/draw/lv_draw_rect.c')
m---------lib/lvgl0
-rw-r--r--lib/lvgl/src/draw/lv_draw_rect.c73
2 files changed, 73 insertions, 0 deletions
diff --git a/lib/lvgl b/lib/lvgl
deleted file mode 160000
-Subproject 0732400e7b564dd0e7dc4a924619d8e19c5b23a
diff --git a/lib/lvgl/src/draw/lv_draw_rect.c b/lib/lvgl/src/draw/lv_draw_rect.c
new file mode 100644
index 00000000..f34854d9
--- /dev/null
+++ b/lib/lvgl/src/draw/lv_draw_rect.c
@@ -0,0 +1,73 @@
+/**
+ * @file lv_draw_rect.c
+ *
+ */
+
+/*********************
+ * INCLUDES
+ *********************/
+#include "lv_draw.h"
+#include "lv_draw_rect.h"
+#include "../misc/lv_assert.h"
+
+/*********************
+ * DEFINES
+ *********************/
+
+/**********************
+ * TYPEDEFS
+ **********************/
+
+/**********************
+ * STATIC PROTOTYPES
+ **********************/
+
+/**********************
+ * STATIC VARIABLES
+ **********************/
+
+/**********************
+ * MACROS
+ **********************/
+
+/**********************
+ * GLOBAL FUNCTIONS
+ **********************/
+
+LV_ATTRIBUTE_FAST_MEM void lv_draw_rect_dsc_init(lv_draw_rect_dsc_t * dsc)
+{
+ lv_memset_00(dsc, sizeof(lv_draw_rect_dsc_t));
+ dsc->bg_color = lv_color_white();
+ dsc->bg_grad.stops[0].color = lv_color_white();
+ dsc->bg_grad.stops[1].color = lv_color_black();
+ dsc->bg_grad.stops[1].frac = 0xFF;
+ dsc->bg_grad.stops_count = 2;
+ dsc->border_color = lv_color_black();
+ dsc->shadow_color = lv_color_black();
+ dsc->bg_img_symbol_font = LV_FONT_DEFAULT;
+ dsc->bg_opa = LV_OPA_COVER;
+ dsc->bg_img_opa = LV_OPA_COVER;
+ dsc->outline_opa = LV_OPA_COVER;
+ dsc->border_opa = LV_OPA_COVER;
+ dsc->shadow_opa = LV_OPA_COVER;
+ dsc->border_side = LV_BORDER_SIDE_FULL;
+}
+
+/**
+ * Draw a rectangle
+ * @param coords the coordinates of the rectangle
+ * @param mask the rectangle will be drawn only in this mask
+ * @param dsc pointer to an initialized `lv_draw_rect_dsc_t` variable
+ */
+void lv_draw_rect(lv_draw_ctx_t * draw_ctx, const lv_draw_rect_dsc_t * dsc, const lv_area_t * coords)
+{
+ if(lv_area_get_height(coords) < 1 || lv_area_get_width(coords) < 1) return;
+
+ draw_ctx->draw_rect(draw_ctx, dsc, coords);
+
+ LV_ASSERT_MEM_INTEGRITY();
+}
+
+/**********************
+ * STATIC FUNCTIONS
+ **********************/