1
0
mirror of https://codeberg.org/vyivel/dulcepan/ synced 2025-03-12 10:49:15 +02:00

Fix selection size rounding

This commit is contained in:
Kirill Primak 2024-06-30 16:10:28 +03:00
parent cd836cc6fa
commit 4c7575b10e
2 changed files with 4 additions and 3 deletions

View File

@ -347,7 +347,8 @@ static void redraw(struct dp_output *output) {
if (output == selection->output) {
double scale = output->scale;
double x = round(selection->x * scale), y = round(selection->y * scale);
double width = round(selection->width * scale), height = round(selection->height * scale);
double width = round((selection->x + selection->width) * scale) - x,
height = round((selection->y + selection->height) * scale) - y;
int border_size = config->border_size;
if (border_size != 0 && width != 0 && height != 0) {

View File

@ -143,8 +143,8 @@ void dp_save(struct dp_state *state) {
double scale = output->scale;
int x = (int)round(selection->x * scale), y = (int)round(selection->y * scale);
int width = (int)round(selection->width * scale),
height = (int)round(selection->height * scale);
int width = (int)round((selection->x + selection->width) * scale) - x,
height = (int)round((selection->y + selection->height) * scale) - y;
pixman_image_t *out_image = pixman_image_create_bits(PIXMAN_a8b8g8r8, width, height, NULL, 0);
pixman_image_composite32(