~sircmpwn/wio

97231a1a8f513f65315c773df71f8a1e43007d6d — Leon Plickat 2 years ago 93dba5a
Selection when reshaping view is now representative

The view was moved to far in the x and y direction compared to the
selection outline by exactly the size of the window border.

(Ammend to this and the previous patch, because apparantly I am blind
and did not see that the variable I was substracting was simply added to
the coordinates a few lines down. Was this added on purpose? Either way,
the selection being precise should be the correct way.)
1 files changed, 5 insertions(+), 5 deletions(-)

M input.c
M input.c => input.c +5 -5
@@ 205,8 205,8 @@ static void view_end_interactive(struct wio_server *server) {
}

static void new_view(struct wio_server *server) {
	int x1 = server->interactive.sx - window_border, x2 = server->cursor->x - window_border;
	int y1 = server->interactive.sy - window_border, y2 = server->cursor->y - window_border;
	int x1 = server->interactive.sx, x2 = server->cursor->x;
	int y1 = server->interactive.sy, y2 = server->cursor->y;
	if (x2 < x1) {
		int _ = x1;
		x1 = x2;


@@ 218,8 218,8 @@ static void new_view(struct wio_server *server) {
		y2 = _;
	}
	struct wio_new_view *view = calloc(1, sizeof(struct wio_new_view));
	view->box.x = x1 + window_border;
	view->box.y = y1 + window_border;
	view->box.x = x1;
	view->box.y = y1;
	view->box.width = x2 - x1;
	view->box.height = y2 - y1;
	int fd[2];


@@ 345,7 345,7 @@ static void handle_button_internal(
			y2 = _;
		}
		wio_view_move(server->interactive.view,
				x1 + window_border, y1 + window_border);
				x1, y1);
		uint32_t width = x2 - x1, height = y2 - y1;
		if (width < 100) {
			width = 100;