diff --git a/meson.build b/meson.build index 781d4de..7d36c66 100644 --- a/meson.build +++ b/meson.build @@ -123,7 +123,6 @@ cage_sources = [ 'idle_inhibit_v1.c', 'output.c', 'seat.c', - 'util.c', 'view.c', 'xdg_shell.c', ] @@ -136,7 +135,6 @@ cage_headers = [ 'output.h', 'seat.h', 'server.h', - 'util.h', 'view.h', 'xdg_shell.h', ] diff --git a/output.c b/output.c index 30d4bcf..11d0a56 100644 --- a/output.c +++ b/output.c @@ -36,7 +36,6 @@ #include "output.h" #include "seat.h" #include "server.h" -#include "util.h" #include "view.h" #if CAGE_HAS_XWAYLAND #include "xwayland.h" diff --git a/util.c b/util.c deleted file mode 100644 index 22b5176..0000000 --- a/util.c +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Cage: A Wayland kiosk. - * - * Copyright (C) 2019 The Sway authors - * - * See the LICENSE file accompanying this file. - */ - -#include - -#include "util.h" - -int -scale_length(int length, int offset, float scale) -{ - /** - * One does not simply multiply the width by the scale. We allow fractional - * scaling, which means the resulting scaled width might be a decimal. - * So we round it. - * - * But even this can produce undesirable results depending on the X or Y - * offset of the box. For example, with a scale of 1.5, a box with - * width=1 should not scale to 2px if its X coordinate is 1, because the - * X coordinate would have scaled to 2px. - */ - return round((offset + length) * scale) - round(offset * scale); -} - -void -scale_box(struct wlr_box *box, float scale) -{ - box->width = scale_length(box->width, box->x, scale); - box->height = scale_length(box->height, box->y, scale); - box->x = round(box->x * scale); - box->y = round(box->y * scale); -} diff --git a/util.h b/util.h deleted file mode 100644 index b6281f3..0000000 --- a/util.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef CG_UTIL_H -#define CG_UTIL_H - -#include - -/** Apply scale to a width or height. */ -int scale_length(int length, int offset, float scale); - -void scale_box(struct wlr_box *box, float scale); - -#endif