improve for awtk web

This commit is contained in:
xianjimli 2019-04-20 12:11:51 +08:00
parent 3a8139150c
commit 131fdadfa6
4 changed files with 20 additions and 2 deletions

View File

@ -1,4 +1,7 @@
# 最新动态
* 2019/04/20
* 为awtk web做了些改进。
* 2019/04/19
* 完善scale算法。
* 优化scale窗口动画。

View File

@ -946,7 +946,14 @@ ret_t widget_paint(widget_t* widget, canvas_t* c) {
widget_layout_children(widget);
}
#if defined(AWTK_WEB)
vgcanvas_t* vg = canvas_get_vgcanvas(c);
vgcanvas_save(vg);
#endif /*AWTK_WEB*/
widget_paint_impl(widget, c);
#if defined(AWTK_WEB)
vgcanvas_restore(vg);
#endif /*AWTK_WEB*/
widget->dirty = FALSE;
return RET_OK;

View File

@ -168,6 +168,10 @@ float_t lcd_vgcanvas_measure_text(lcd_t* lcd, const wchar_t* str, uint32_t nr) {
vgcanvas_t* canvas = LCD(lcd)->canvas;
return_value_if_fail(nr < MAX_CHARS, RET_FAIL);
if (nr == 0) {
return 0;
}
wcsncpy(temp, str, nr);
temp[nr] = 0;
@ -184,6 +188,10 @@ static ret_t lcd_vgcanvas_draw_text(lcd_t* lcd, const wchar_t* str, uint32_t nr,
vgcanvas_t* canvas = LCD(lcd)->canvas;
return_value_if_fail(nr < MAX_CHARS, RET_FAIL);
if (nr == 0) {
return RET_OK;
}
wcsncpy(temp, str, nr);
temp[nr] = 0;

View File

@ -161,7 +161,7 @@ uint32_t dialog_modal(widget_t* widget) {
idle_add(dialog_idle_close, widget);
return dialog->quit_code;
#endif/*AWTK_WEB*/
#endif /*AWTK_WEB*/
}
ret_t dialog_quit(widget_t* widget, uint32_t code) {
@ -175,7 +175,7 @@ ret_t dialog_quit(widget_t* widget, uint32_t code) {
dialog->quited = TRUE;
dialog->quit_code = code;
main_loop_quit(main_loop());
#endif/*AWTK_WEB*/
#endif /*AWTK_WEB*/
return RET_OK;
}