mirror of
https://github.com/swaywm/sway.git
synced 2024-11-14 14:34:07 +01:00
get_tree: percent cast to double on division
This commit is contained in:
parent
79eaa26b3e
commit
2dec0d894b
@ -153,8 +153,8 @@ static void ipc_json_describe_output(struct sway_output *output,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (parent_box.width != 0 && parent_box.height != 0) {
|
if (parent_box.width != 0 && parent_box.height != 0) {
|
||||||
double percent = (output->width / parent_box.width)
|
double percent = ((double)output->width / (double)parent_box.width)
|
||||||
* (output->height / parent_box.height);
|
* ((double)output->height / (double)parent_box.height);
|
||||||
json_object_object_add(object, "percent", json_object_new_double(percent));
|
json_object_object_add(object, "percent", json_object_new_double(percent));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -292,8 +292,8 @@ static void ipc_json_describe_container(struct sway_container *c, json_object *o
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (parent_box.width != 0 && parent_box.height != 0) {
|
if (parent_box.width != 0 && parent_box.height != 0) {
|
||||||
double percent = (c->width / parent_box.width)
|
double percent = ((double)c->width / (double)parent_box.width)
|
||||||
* (c->height / parent_box.height);
|
* ((double)c->height / (double)parent_box.height);
|
||||||
json_object_object_add(object, "percent", json_object_new_double(percent));
|
json_object_object_add(object, "percent", json_object_new_double(percent));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user