MCPcopy Create free account
hub / github.com/KDAB/GammaRay / updateUserViewport

Method updateUserViewport

ui/remoteviewwidget.cpp:231–258  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

229}
230
231void 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
260const RemoteViewFrame &RemoteViewWidget::frame() const
261{

Callers

nothing calls this directly

Calls 4

QPointFClass · 0.85
viewRectMethod · 0.80
QRectFClass · 0.50
sendUserViewportMethod · 0.45

Tested by

no test coverage detected