Update to new gfx::Region API

This commit is contained in:
David Capello 2019-05-03 09:34:34 -03:00
parent 97345f4866
commit 4004f7be65
2 changed files with 5 additions and 5 deletions

2
laf

@ -1 +1 @@
Subproject commit ad6dff6dffb3e1ff73140d00714725dee7ecb0fc
Subproject commit 9d5e9ac44c4b010360b233f903afcaf32a54ca39

View File

@ -36,11 +36,10 @@ void move_region(Manager* manager, const Region& region, int dx, int dy)
os::Surface* surface = display->getSurface();
os::SurfaceLock lock(surface);
std::size_t nrects = region.size();
// Fast path, move one rectangle.
if (nrects == 1) {
gfx::Rect rc = region[0];
if (region.isRect()) {
gfx::Rect rc = region.bounds();
surface->scrollTo(rc, dx, dy);
rc.offset(dx, dy);
@ -50,7 +49,8 @@ void move_region(Manager* manager, const Region& region, int dx, int dy)
// through the y-axis, we can sort the rectangles by y-axis and then
// by x-axis to move rectangle by rectangle depending on the dx/dy
// direction so we don't overlap each rectangle.
else if (nrects > 1) {
else if (region.isComplex()) {
std::size_t nrects = region.size();
std::vector<gfx::Rect> rcs(nrects);
std::copy(region.begin(), region.end(), rcs.begin());