From 8bee9c2d34440bf136ed79fe9ff99aced5592210 Mon Sep 17 00:00:00 2001 From: Liu Chao Date: Sun, 5 Aug 2018 23:30:02 +0800 Subject: [PATCH] fix(gui): Widget_AutoSize() should not change the static width or height --- src/gui/widget_base.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/gui/widget_base.c b/src/gui/widget_base.c index e32a9223f..afabc31cf 100755 --- a/src/gui/widget_base.c +++ b/src/gui/widget_base.c @@ -1217,6 +1217,12 @@ void Widget_ComputeContentSize(LCUI_Widget w, float *width, float *height) void Widget_AutoSize(LCUI_Widget w) { float width = 0, height = 0; + if (!Widget_CheckStyleType(w, key_width, scale)) { + width = ComputeXMetric(w, key_width); + } + if (!Widget_CheckStyleType(w, key_height, scale)) { + height = ComputeYMetric(w, key_height); + } Widget_ComputeContentSize(w, &width, &height); width = Widget_GetAdjustedWidth(w, width); Widget_SetSize(w, ToBorderBoxWidth(w, width),