MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / updateManualSnapIndicator

Method updateManualSnapIndicator

app/src/UI/WindowManager.cpp:1720–1735  ·  view source on GitHub ↗

* @brief Updates the manual-mode edge snap indicator based on the dragged window position. */

Source from the content-addressed store, hash-verified

1718 * @brief Updates the manual-mode edge snap indicator based on the dragged window position.
1719 */
1720void UI::WindowManager::updateManualSnapIndicator(
1721 int newX, int newY, int w, int h, int canvasW, int canvasH)
1722{
1723 const auto snap = computeSnapRect(newX, newY, newX + w, newY + h, canvasW, canvasH);
1724 if (snap.has_value()) {
1725 m_snapIndicator = *snap;
1726 m_snapIndicatorVisible = true;
1727 Q_EMIT snapIndicatorChanged();
1728 return;
1729 }
1730
1731 if (m_snapIndicatorVisible) {
1732 m_snapIndicatorVisible = false;
1733 Q_EMIT snapIndicatorChanged();
1734 }
1735}
1736
1737/**
1738 * @brief Applies a drag delta to the focused window and updates snap indicators.

Callers

nothing calls this directly

Calls 1

computeSnapRectFunction · 0.85

Tested by

no test coverage detected