Commit 3a83ce62 authored by Tobias Junghans's avatar Tobias Junghans
Browse files

Use C++11 loops

parent a109e3d6
...@@ -483,10 +483,10 @@ void XCBFrameBuffer::cleanupRects() { ...@@ -483,10 +483,10 @@ void XCBFrameBuffer::cleanupRects() {
QRect ri = r.intersected(d->area); QRect ri = r.intersected(d->area);
if (tiles.size() > 0) { if (tiles.size() > 0) {
for (int i = 0; i < tiles.size(); i++) { for (auto &tile : tiles) {
// if current rect has intersection with tiles[i], unite them // if current rect has intersection with tile, unite them
if (ri.intersects(tiles[i])) { if (ri.intersects(tile)) {
tiles[i] |= ri; tile |= ri;
inserted = true; inserted = true;
break; break;
} }
...@@ -504,25 +504,25 @@ void XCBFrameBuffer::cleanupRects() { ...@@ -504,25 +504,25 @@ void XCBFrameBuffer::cleanupRects() {
// increase all rectangles size by 30 pixels each side. // increase all rectangles size by 30 pixels each side.
// limit coordinates to primary monitor boundaries. // limit coordinates to primary monitor boundaries.
for (int i = 0; i < tiles.size(); i++) { for (auto &tile : tiles) {
tiles[i].adjust(-30, -30, 30, 30); tile.adjust(-30, -30, 30, 30);
if (tiles[i].top() < d->area.top()) { if (tile.top() < d->area.top()) {
tiles[i].setTop(d->area.top()); tile.setTop(d->area.top());
} }
if (tiles[i].bottom() > d->area.bottom()) { if (tile.bottom() > d->area.bottom()) {
tiles[i].setBottom(d->area.bottom()); tile.setBottom(d->area.bottom());
} }
// //
if (tiles[i].left() < d->area.left()) { if (tile.left() < d->area.left()) {
tiles[i].setLeft(d->area.left()); tile.setLeft(d->area.left());
} }
if (tiles[i].right() > d->area.right()) { if (tile.right() > d->area.right()) {
tiles[i].setRight(d->area.right()); tile.setRight(d->area.right());
} }
// move update rects so that they are positioned relative to // move update rects so that they are positioned relative to
// framebuffer image, not whole screen // framebuffer image, not whole screen
tiles[i].moveTo(tiles[i].left() - d->area.left(), tile.moveTo(tile.left() - d->area.left(),
tiles[i].top() - d->area.top()); tile.top() - d->area.top());
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment