1
0
Fork 0
mirror of https://github.com/yshui/picom.git synced 2025-10-30 23:46:46 -04:00

api/backend: change backend_mask_image.origin from ivec2 to vec2

A bit more precision for mask images. An attempt to reduce gaps when
window/shadow is scaled.

Changelog: Internal: Backend API 2.0 breaking change,
backend_mask_image.origin is now a vec2.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui 2025-08-22 23:24:08 +01:00
parent 4715498b20
commit c1b8fea1b6
No known key found for this signature in database
GPG key ID: D3A4405BE6CC17F4
4 changed files with 15 additions and 11 deletions

View file

@ -92,7 +92,7 @@ struct backend_mask_image {
/// rounded.
double corner_radius;
/// Origin of the mask image, in the source image's coordinate.
ivec2 origin;
vec2 origin;
/// Whether the mask image should be inverted.
bool inverted;
};

View file

@ -144,6 +144,10 @@ static inline vec2 vec2_add(vec2 a, vec2 b) {
};
}
static inline vec2 vec2_neg(vec2 a) {
return (vec2){.x = -a.x, .y = -a.y};
}
static inline vec2 vec2_ceil(vec2 a) {
return (vec2){
.x = ceil(a.x),