lc-soft / LCUI

C library for building user interfaces
https://lcui-dev.github.io
MIT License
4.13k stars 355 forks source link

[gui] max-width compute result are incorrect #113

Closed lc-soft closed 6 years ago

lc-soft commented 6 years ago

Expected result:

image

Actual result:

image

image

image

lc-soft commented 6 years ago

Here has a stylesheet selection bug from src/gui/css_library.c#L1104

Example:

.col-6 {
  display: inline-block;
  max-width: 100%;
}
 .col {
  width: 100%;
  max-width: 100%;
}
.col-6 {
  max-width: 50%;
}

The effect of the above code is equivalent to the following code:

.col-6 {
  display: inline-block;
  max-width: 50%;
}
 .col {
  width: 100%;
  max-width: 100%;
}

The two stylesheets will be merged into a single styleesheet.

lc-soft commented 6 years ago

Done.

image