You can now prefix a size with % and it will do percentage for the size, even over 100.
This commit is contained in:
parent
d558da1620
commit
c03a384372
6 changed files with 60 additions and 46 deletions
5
lel.cpp
5
lel.cpp
|
@ -40,6 +40,11 @@ namespace lel {
|
|||
cell.max_w = cell.max_w == 0 ? cell_width : cell.max_w;
|
||||
cell.max_h = cell.max_h == 0 ? cell_height : cell.max_h;
|
||||
|
||||
if(cell.percent) {
|
||||
cell.max_w = cell.max_w * 0.01 * cell_width;
|
||||
cell.max_h = cell.max_h * 0.01 * cell_height;
|
||||
}
|
||||
|
||||
cell.w = cell.expand ? std::min(cell.max_w, grid_w) : std::min(cell_width, cell.max_w);
|
||||
cell.h = cell.expand ? std::min(cell.max_h, grid_h) : std::min(cell_height, cell.max_h);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue