diff options
Diffstat (limited to 'src/desktop/WLSurface.cpp')
| -rw-r--r-- | src/desktop/WLSurface.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/desktop/WLSurface.cpp b/src/desktop/WLSurface.cpp index d868e1a9..1a1bd293 100644 --- a/src/desktop/WLSurface.cpp +++ b/src/desktop/WLSurface.cpp @@ -62,9 +62,10 @@ bool CWLSurface::small() const { if (!m_resource->m_current.texture) return false; - const auto O = m_windowOwner.lock(); + const auto O = m_windowOwner.lock(); + const auto REPORTED_SIZE = O->getReportedSize(); - return O->m_reportedSize.x > m_resource->m_current.size.x + 1 || O->m_reportedSize.y > m_resource->m_current.size.y + 1; + return REPORTED_SIZE.x > m_resource->m_current.size.x + 1 || REPORTED_SIZE.y > m_resource->m_current.size.y + 1; } Vector2D CWLSurface::correctSmallVec() const { @@ -73,8 +74,9 @@ Vector2D CWLSurface::correctSmallVec() const { const auto SIZE = getViewporterCorrectedSize(); const auto O = m_windowOwner.lock(); + const auto REP = O->getReportedSize(); - return Vector2D{(O->m_reportedSize.x - SIZE.x) / 2, (O->m_reportedSize.y - SIZE.y) / 2}.clamp({}, {INFINITY, INFINITY}) * (O->m_realSize->value() / O->m_reportedSize); + return Vector2D{(REP.x - SIZE.x) / 2, (REP.y - SIZE.y) / 2}.clamp({}, {INFINITY, INFINITY}) * (O->m_realSize->value() / REP); } Vector2D CWLSurface::correctSmallVecBuf() const { |
