Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4c0a1705 authored by Mathias Agopian's avatar Mathias Agopian
Browse files

don't generate a new Region when translating by 0,0

since regions are copy-on-write, this prevents to
duplicate the region entirely and offseting by 0,0 is
fairly common.

Change-Id: I9b8c286315a2e00dda01c2456397d72b5e12006b
parent 2098517e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -529,7 +529,7 @@ void Region::boolean_operation(int op, Region& dst,

void Region::translate(Region& reg, int dx, int dy)
{
    if (!reg.isEmpty()) {
    if ((dx || dy) && !reg.isEmpty()) {
#if VALIDATE_REGIONS
        validate(reg, "translate (before)");
#endif