Changeset View
Changeset View
Standalone View
Standalone View
effects/presentwindows/presentwindows.cpp
Show First 20 Lines • Show All 1341 Lines • ▼ Show 20 Line(s) | 1231 | { | |||
---|---|---|---|---|---|
1342 | if (bounds == area) | 1342 | if (bounds == area) | ||
1343 | scale = 1.0; // Don't add borders to the screen | 1343 | scale = 1.0; // Don't add borders to the screen | ||
1344 | else if (area.width() / double(bounds.width()) < area.height() / double(bounds.height())) | 1344 | else if (area.width() / double(bounds.width()) < area.height() / double(bounds.height())) | ||
1345 | scale = (area.width() - 20) / double(bounds.width()); | 1345 | scale = (area.width() - 20) / double(bounds.width()); | ||
1346 | else | 1346 | else | ||
1347 | scale = (area.height() - 20) / double(bounds.height()); | 1347 | scale = (area.height() - 20) / double(bounds.height()); | ||
1348 | // Make bounding rect fill the screen size for later steps | 1348 | // Make bounding rect fill the screen size for later steps | ||
1349 | bounds = QRect( | 1349 | bounds = QRect( | ||
1350 | bounds.x() - (area.width() - 20 - bounds.width() * scale) / 2 - 10 / scale, | 1350 | (bounds.x() * scale - (area.width() - 20 - bounds.width() * scale) / 2 - 10) / scale, | ||
1351 | bounds.y() - (area.height() - 20 - bounds.height() * scale) / 2 - 10 / scale, | 1351 | (bounds.y() * scale - (area.height() - 20 - bounds.height() * scale) / 2 - 10) / scale, | ||
1352 | area.width() / scale, | 1352 | area.width() / scale, | ||
1353 | area.height() / scale | 1353 | area.height() / scale | ||
1354 | ); | 1354 | ); | ||
1355 | 1355 | | |||
1356 | // Move all windows back onto the screen and set their scale | 1356 | // Move all windows back onto the screen and set their scale | ||
1357 | QHash<EffectWindow*, QRect>::iterator target = targets.begin(); | 1357 | QHash<EffectWindow*, QRect>::iterator target = targets.begin(); | ||
1358 | while (target != targets.end()) { | 1358 | while (target != targets.end()) { | ||
1359 | target->setRect((target->x() - bounds.x()) * scale + area.x(), | 1359 | target->setRect((target->x() - bounds.x()) * scale + area.x(), | ||
▲ Show 20 Lines • Show All 607 Lines • Show Last 20 Lines |