| 229 | } |
| 230 | |
| 231 | void RemoteViewWidget::updateUserViewport() |
| 232 | { |
| 233 | if (!isVisible()) |
| 234 | return; |
| 235 | |
| 236 | const auto userViewport = QRectF(QPointF(std::floor(-m_x / m_zoom), std::floor(-m_y / m_zoom)), |
| 237 | QSizeF(std::ceil(width() / m_zoom) + 1, std::ceil(height() / m_zoom) + 1)); |
| 238 | |
| 239 | // When We update the viewport by zooming out we need one additional |
| 240 | // frameupdate from the application before stopping to send userViewports, |
| 241 | // or otherwise the newly appeared area stays empty :( |
| 242 | |
| 243 | // If we would skip, but need an extra update |
| 244 | if (userViewport.contains(frame().viewRect()) && m_extraViewportUpdateNeeded) { |
| 245 | m_extraViewportUpdateNeeded = false; |
| 246 | m_interface->sendUserViewport(userViewport); |
| 247 | return; |
| 248 | } |
| 249 | |
| 250 | // Regular skip |
| 251 | if (userViewport.contains(frame().viewRect())) { |
| 252 | return; |
| 253 | } |
| 254 | |
| 255 | // Refill extra-update again once we needed a real update |
| 256 | m_extraViewportUpdateNeeded = true; |
| 257 | m_interface->sendUserViewport(userViewport); |
| 258 | } |
| 259 | |
| 260 | const RemoteViewFrame &RemoteViewWidget::frame() const |
| 261 | { |
nothing calls this directly
no test coverage detected