diff --git a/.github/stale.yml b/.github/stale.yml index 1b48a4379..914189811 100644 --- a/.github/stale.yml +++ b/.github/stale.yml @@ -7,7 +7,7 @@ exemptLabels: - architecture - pinned # Label to use when marking an issue as stale -# staleLabel: + staleLabel: stale # Comment to post when marking an issue as stale. Set to `false` to disable markComment: > This issue or pull request has been automatically marked as stale because it has not had diff --git a/README.md b/README.md index 8f30b4676..cb9a00527 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@

LittlevGL - Open-source Embedded GUI Library

- - + +
- +

@@ -62,7 +62,7 @@ The easiest way to get started with LittlevGL is to run it in a simulator on you Choose a project with your favourite IDE: -| Eclipse | CodeBlock | Visual Studio | PlatfomIO | Qt Creator | +| Eclipse | CodeBlock | Visual Studio | PlatformIO | Qt Creator | |-------------|----------- |---------------|-----------|------------| | [![Eclipse](https://littlevgl.com/logo/ide/eclipse.jpg)](https://github.com/littlevgl/pc_simulator_sdl_eclipse) | [![CodeBlocks](https://littlevgl.com/logo/ide/codeblocks.jpg)](https://github.com/littlevgl/pc_simulator_win_codeblocks) | [![VisualStudio](https://littlevgl.com/logo/ide/visualstudio.jpg)](https://github.com/littlevgl/visual_studio_2017_sdl_x64) | [![PlatformIO](https://littlevgl.com/logo/ide/platformio.jpg)](https://github.com/littlevgl/pc_simulator_sdl_platformio) | [![QtCreator](https://littlevgl.com/logo/ide/qtcreator.jpg)](https://blog.littlevgl.com/2019-01-03/qt-creator) | | Cross-platform
with SDL | Native Windows | Cross-platform
with SDL | Cross-platform
with SDL | Cross-platform
with SDL | @@ -105,20 +105,20 @@ bool touchpad_read(lv_indev_data_t * data) static lv_coord_t last_x = 0; static lv_coord_t last_y = 0; - /*Save the state and save the pressed cooridnate*/ + /*Save the state and save the pressed coordinate*/ data->state = touchpad_is_pressed() ? LV_INDEV_STATE_PR : LV_INDEV_STATE_REL; if(data->state == LV_INDEV_STATE_PR) touchpad_get_xy(&last_x, &last_y); - /*Set the coordinates (if released use the last pressed cooridantes)*/ + /*Set the coordinates (if released use the last pressed coordinates)*/ data->point.x = last_x; data->point.y = last_y; return false; /*Return `false` because we are not buffering and no more data to read*/ } ``` -6. Call `lv_task_handler()` periodically every few milliseconds. +6. Call `lv_task_handler()` periodically every few milliseconds in the main `while(1)` loop, in Timer interrupt or in an Operation system task. -For a detailed description check the [Online documatation](https://docs.littlevgl.com/#Porting) or the [Porting tutorial](https://github.com/littlevgl/lv_examples/blob/master/lv_tutorial/0_porting/lv_tutorial_porting.c) +For a detailed description check the [Documentation](https://docs.littlevgl.com/#Porting) or the [Porting tutorial](https://github.com/littlevgl/lv_examples/blob/master/lv_tutorial/0_porting/lv_tutorial_porting.c) ### Code examples @@ -154,15 +154,15 @@ style_btn_rel.body.radius = LV_RADIUS_CIRCLE; style_btn_rel.text.color = LV_COLOR_HEX3(0xDEF); static lv_style_t style_btn_pr; /*A variable to store the pressed style*/ -lv_style_copy(&style_btn_pr, &style_btn_rel); /*Initialize from a built-in style*/ +lv_style_copy(&style_btn_pr, &style_btn_rel); /*Initialize from the released style*/ style_btn_pr.body.border.color = LV_COLOR_HEX3(0x46B); style_btn_pr.body.main_color = LV_COLOR_HEX3(0x8BD); style_btn_pr.body.grad_color = LV_COLOR_HEX3(0x24A); style_btn_pr.body.shadow.width = 2; style_btn_pr.text.color = LV_COLOR_HEX3(0xBCD); -lv_btn_set_style(btn, LV_BTN_STYLE_REL, &style_btn_rel); /*Set the buton's released style*/ -lv_btn_set_style(btn, LV_BTN_STYLE_PR, &style_btn_pr); /*Set the buton's pressed style*/ +lv_btn_set_style(btn, LV_BTN_STYLE_REL, &style_btn_rel); /*Set the button's released style*/ +lv_btn_set_style(btn, LV_BTN_STYLE_PR, &style_btn_pr); /*Set the button's pressed style*/ ``` ![Simple button with LittelvGL](https://littlevgl.com/github/btn2.gif) diff --git a/lv_objx/lv_canvas.c b/lv_objx/lv_canvas.c index 12fea9783..32e47b71a 100644 --- a/lv_objx/lv_canvas.c +++ b/lv_objx/lv_canvas.c @@ -340,9 +340,27 @@ void lv_canvas_mult_buf(lv_obj_t * canvas, void * to_copy, lv_coord_t w, lv_coor lv_coord_t j; for(i = 0; i < h; i++) { for(j = 0; j < w; j++) { +#if LV_COLOR_DEPTH == 32 canvas_buf_color[j].red = (uint16_t) ((uint16_t) canvas_buf_color[j].red * copy_buf_color[j].red) >> 8; canvas_buf_color[j].green = (uint16_t) ((uint16_t) canvas_buf_color[j].green * copy_buf_color[j].green) >> 8; canvas_buf_color[j].blue = (uint16_t) ((uint16_t) canvas_buf_color[j].blue * copy_buf_color[j].blue) >> 8; +#elif LV_COLOR_DEPTH == 16 + + canvas_buf_color[j].red = (uint16_t) ((uint16_t) canvas_buf_color[j].red * copy_buf_color[j].red) >> 5; + canvas_buf_color[j].blue = (uint16_t) ((uint16_t) canvas_buf_color[j].blue * copy_buf_color[j].blue) >> 5; +# if LV_COLOR_16_SWAP == 0 + canvas_buf_color[j].green = (uint16_t) ((uint16_t) canvas_buf_color[j].green * copy_buf_color[j].green) >> 6; +# else + canvas_buf_color[j].red = (uint16_t) ((uint16_t) canvas_buf_color[j].red * copy_buf_color[j].red) >> 6; + canvas_buf_color[j].blue = (uint16_t) ((uint16_t) canvas_buf_color[j].blue * copy_buf_color[j].blue) >> 6; + canvas_buf_color[j].red = (uint16_t) ((uint16_t) canvas_buf_color[j].red * copy_buf_color[j].red) >> 6; +# endif /*LV_COLOR_16_SWAP*/ + +#elif LV_COLOR_DEPTH == 8 + canvas_buf_color[j].red = (uint16_t) ((uint16_t) canvas_buf_color[j].red * copy_buf_color[j].red) >> 3; + canvas_buf_color[j].green = (uint16_t) ((uint16_t) canvas_buf_color[j].green * copy_buf_color[j].green) >> 3; + canvas_buf_color[j].blue = (uint16_t) ((uint16_t) canvas_buf_color[j].blue * copy_buf_color[j].blue) >> 2; +#endif } copy_buf_color += w; canvas_buf_color += ext->dsc.header.w;