From e3d2224b553f83782f0fbf626a1aa194f25d0d51 Mon Sep 17 00:00:00 2001 From: Simon Long Date: Fri, 3 May 2024 11:49:05 +0100 Subject: [PATCH] It's hip to (not) be square... --- docs/rc.xml.all | 12 +++++++----- include/config/rcxml.h | 3 ++- src/common/scene-helpers.c | 8 ++++---- src/config/rcxml.c | 9 ++++++--- 4 files changed, 19 insertions(+), 13 deletions(-) diff --git a/docs/rc.xml.all b/docs/rc.xml.all index dcf011c6..9ce41049 100644 --- a/docs/rc.xml.all +++ b/docs/rc.xml.all @@ -589,17 +589,19 @@ - 400 + 400 + 400 2 #ff0000 1 diff --git a/include/config/rcxml.h b/include/config/rcxml.h index bab9913b..a28a5d7a 100644 --- a/include/config/rcxml.h +++ b/include/config/rcxml.h @@ -146,7 +146,8 @@ struct rcxml { /* magnifier */ int mag_scale; - int mag_size; + int mag_width; + int mag_height; struct rgb_colour mag_border_col; int mag_border_width; bool mag_filter; diff --git a/src/common/scene-helpers.c b/src/common/scene-helpers.c index 5836ce93..3b18bdfb 100644 --- a/src/common/scene-helpers.c +++ b/src/common/scene-helpers.c @@ -74,10 +74,10 @@ magnify(struct output *output, struct wlr_buffer *output_buffer, struct wlr_box ox *= output->wlr_output->scale; oy *= output->wlr_output->scale; - int width = rc.mag_size + 1; - int height = width; - double x = ox - (rc.mag_size / 2.0); - double y = oy - (rc.mag_size / 2.0); + int width = rc.mag_width + 1; + int height = rc.mag_height + 1; + double x = ox - (rc.mag_width / 2.0); + double y = oy - (rc.mag_height / 2.0); double cropped_width = width; double cropped_height = height; double dst_x = 0; diff --git a/src/config/rcxml.c b/src/config/rcxml.c index 82d4c64b..e3c0b8f0 100644 --- a/src/config/rcxml.c +++ b/src/config/rcxml.c @@ -1047,8 +1047,10 @@ entry(xmlNode *node, char *nodename, char *content) } else { wlr_log(WLR_ERROR, "Missing 'button' argument for tablet button mapping"); } - } else if (!strcasecmp(nodename, "size.magnifier")) { - rc.mag_size = atoi(content); + } else if (!strcasecmp(nodename, "width.magnifier")) { + rc.mag_width = atoi(content); + } else if (!strcasecmp(nodename, "height.magnifier")) { + rc.mag_height = atoi(content); } else if (!strcasecmp(nodename, "initScale.magnifier")) { rc.mag_scale = atoi(content); } else if (!strcasecmp(nodename, "borderColour.magnifier")) { @@ -1264,7 +1266,8 @@ rcxml_init(void) rc.workspace_config.min_nr_workspaces = 1; rc.mag_scale = 2; - rc.mag_size = 400; + rc.mag_width = 400; + rc.mag_height = 400; rc.mag_border_col.r = 255; rc.mag_border_col.g = 0; rc.mag_border_col.b = 0;