mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2024-11-25 00:22:25 +00:00
util/region: forbid "shrinking" a region with wlr_region_expand()
The logic isn't correct.
This commit is contained in:
parent
32fc23a383
commit
8f58c060fd
@ -39,8 +39,8 @@ void wlr_region_transform(pixman_region32_t *dst, const pixman_region32_t *src,
|
|||||||
enum wl_output_transform transform, int width, int height);
|
enum wl_output_transform transform, int width, int height);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Expands the region of `distance`. If `distance` is negative, it shrinks the
|
* Expands the region by distance on both axis. distance must be
|
||||||
* region.
|
* a non-negative number.
|
||||||
*/
|
*/
|
||||||
void wlr_region_expand(pixman_region32_t *dst, const pixman_region32_t *src,
|
void wlr_region_expand(pixman_region32_t *dst, const pixman_region32_t *src,
|
||||||
int distance);
|
int distance);
|
||||||
|
@ -111,6 +111,8 @@ void wlr_region_transform(pixman_region32_t *dst, const pixman_region32_t *src,
|
|||||||
|
|
||||||
void wlr_region_expand(pixman_region32_t *dst, const pixman_region32_t *src,
|
void wlr_region_expand(pixman_region32_t *dst, const pixman_region32_t *src,
|
||||||
int distance) {
|
int distance) {
|
||||||
|
assert(distance >= 0);
|
||||||
|
|
||||||
if (distance == 0) {
|
if (distance == 0) {
|
||||||
pixman_region32_copy(dst, src);
|
pixman_region32_copy(dst, src);
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user