Skip to content

Commit 8bee9c2

Browse files
committed
fix(gui): Widget_AutoSize() should not change the static width or height
1 parent adcb9e7 commit 8bee9c2

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/gui/widget_base.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1217,6 +1217,12 @@ void Widget_ComputeContentSize(LCUI_Widget w, float *width, float *height)
12171217
void Widget_AutoSize(LCUI_Widget w)
12181218
{
12191219
float width = 0, height = 0;
1220+
if (!Widget_CheckStyleType(w, key_width, scale)) {
1221+
width = ComputeXMetric(w, key_width);
1222+
}
1223+
if (!Widget_CheckStyleType(w, key_height, scale)) {
1224+
height = ComputeYMetric(w, key_height);
1225+
}
12201226
Widget_ComputeContentSize(w, &width, &height);
12211227
width = Widget_GetAdjustedWidth(w, width);
12221228
Widget_SetSize(w, ToBorderBoxWidth(w, width),

0 commit comments

Comments
 (0)