Skip to content

Commit

Permalink
fix(gui): Widget_AutoSize() should not change the static width or height
Browse files Browse the repository at this point in the history
  • Loading branch information
lc-soft committed Aug 5, 2018
1 parent adcb9e7 commit 8bee9c2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/gui/widget_base.c
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit 8bee9c2

Please sign in to comment.