aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTony Crisci <tony@dubstepdish.com>2018-03-28 18:40:55 -0400
committerTony Crisci <tony@dubstepdish.com>2018-03-28 18:40:55 -0400
commitbf5ae85683963a03b9291dd7ab184ab97abc0fd4 (patch)
tree0443967e052c7144178c82801d3341377552ce22
parent67c8aec77f27aa08528a69894a045a48d67bd658 (diff)
return early when no dest_x/y in output layout closest point
-rw-r--r--types/wlr_output_layout.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/types/wlr_output_layout.c b/types/wlr_output_layout.c
index 8d328c17..fdeef387 100644
--- a/types/wlr_output_layout.c
+++ b/types/wlr_output_layout.c
@@ -313,6 +313,10 @@ void wlr_output_layout_output_coords(struct wlr_output_layout *layout,
void wlr_output_layout_closest_point(struct wlr_output_layout *layout,
struct wlr_output *reference, double x, double y, double *dest_x,
double *dest_y) {
+ if (dest_x == NULL && dest_y == NULL) {
+ return;
+ }
+
double min_x = DBL_MAX, min_y = DBL_MAX, min_distance = DBL_MAX;
struct wlr_output_layout_output *l_output;
wl_list_for_each(l_output, &layout->outputs, link) {