mirror of
https://github.com/labwc/labwc.git
synced 2026-04-09 08:21:18 -04:00
Merge a31ce37701 into afaed4af63
This commit is contained in:
commit
50c3ca923c
1 changed files with 4 additions and 4 deletions
|
|
@ -685,12 +685,12 @@ substitute_nonzero(int *a, int *b)
|
|||
}
|
||||
|
||||
static int
|
||||
round_to_increment(int val, int base, int inc)
|
||||
round_down_to_increment(int val, int base, int inc)
|
||||
{
|
||||
if (base < 0 || inc <= 0) {
|
||||
return val;
|
||||
}
|
||||
return base + (val - base + inc / 2) / inc * inc;
|
||||
return base + (val - base) / inc * inc;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -712,8 +712,8 @@ view_adjust_size(struct view *view, int *w, int *h)
|
|||
* terminal is resized to a width/height evenly divisible by the
|
||||
* cell (character) size.
|
||||
*/
|
||||
*w = round_to_increment(*w, hints.base_width, hints.width_inc);
|
||||
*h = round_to_increment(*h, hints.base_height, hints.height_inc);
|
||||
*w = round_down_to_increment(*w, hints.base_width, hints.width_inc);
|
||||
*h = round_down_to_increment(*h, hints.base_height, hints.height_inc);
|
||||
|
||||
/* If a minimum width/height was not set, then use default */
|
||||
if (hints.min_width < 1) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue