refactor window geometry checking

master
Kristen McWilliam 11 months ago committed by Noah Davis
parent 5c8b85861e
commit 53a4faf4e6

@ -228,17 +228,21 @@ void ScreenShotEffect::takeScreenShot(ScreenShotWindowData *screenshot)
WindowPaintData d; WindowPaintData d;
QRectF geometry = window->expandedGeometry(); QRectF geometry = window->expandedGeometry();
qreal devicePixelRatio = 1; qreal devicePixelRatio = 1;
if (window->hasDecoration() && !(screenshot->flags & ScreenShotIncludeDecoration)) { bool includeDecorations = (screenshot->flags & ScreenShotIncludeDecoration);
bool includeShadow = (screenshot->flags & ScreenShotIncludeShadow);
if (window->hasDecoration() && !includeDecorations) {
geometry = window->clientGeometry(); geometry = window->clientGeometry();
} } else if (window->hasDecoration() && !includeShadow) {
if (window->hasDecoration() && !(screenshot->flags & ScreenShotIncludeShadow)) {
geometry = window->frameGeometry(); geometry = window->frameGeometry();
} }
if (screenshot->flags & ScreenShotNativeResolution) { if (screenshot->flags & ScreenShotNativeResolution) {
if (const EffectScreen *screen = window->screen()) { if (const EffectScreen *screen = window->screen()) {
devicePixelRatio = screen->devicePixelRatio(); devicePixelRatio = screen->devicePixelRatio();
} }
} }
bool validTarget = true; bool validTarget = true;
std::unique_ptr<GLTexture> offscreenTexture; std::unique_ptr<GLTexture> offscreenTexture;
std::unique_ptr<GLFramebuffer> target; std::unique_ptr<GLFramebuffer> target;

Loading…
Cancel
Save