diff options
-rw-r--r-- | sway/ipc-json.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sway/ipc-json.c b/sway/ipc-json.c index fc65b5f2..682186d5 100644 --- a/sway/ipc-json.c +++ b/sway/ipc-json.c | |||
@@ -153,8 +153,8 @@ static void ipc_json_describe_output(struct sway_output *output, | |||
153 | } | 153 | } |
154 | 154 | ||
155 | if (parent_box.width != 0 && parent_box.height != 0) { | 155 | if (parent_box.width != 0 && parent_box.height != 0) { |
156 | double percent = (output->width / parent_box.width) | 156 | double percent = ((double)output->width / (double)parent_box.width) |
157 | * (output->height / parent_box.height); | 157 | * ((double)output->height / (double)parent_box.height); |
158 | json_object_object_add(object, "percent", json_object_new_double(percent)); | 158 | json_object_object_add(object, "percent", json_object_new_double(percent)); |
159 | } | 159 | } |
160 | } | 160 | } |
@@ -292,8 +292,8 @@ static void ipc_json_describe_container(struct sway_container *c, json_object *o | |||
292 | } | 292 | } |
293 | 293 | ||
294 | if (parent_box.width != 0 && parent_box.height != 0) { | 294 | if (parent_box.width != 0 && parent_box.height != 0) { |
295 | double percent = (c->width / parent_box.width) | 295 | double percent = ((double)c->width / (double)parent_box.width) |
296 | * (c->height / parent_box.height); | 296 | * ((double)c->height / (double)parent_box.height); |
297 | json_object_object_add(object, "percent", json_object_new_double(percent)); | 297 | json_object_object_add(object, "percent", json_object_new_double(percent)); |
298 | } | 298 | } |
299 | 299 | ||