chenluhua1980
2 天以前 b099ab8b7c83dc957bd9777a0bb90c1d8202056b
1.点一下Port时,连接线重新计算后有重叠。增加防抖功能
已修改1个文件
14 ■■■■■ 文件已修改
SourceCode/Bond/Servo/EqsGraphWnd.cpp 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/EqsGraphWnd.cpp
@@ -1464,6 +1464,8 @@
        GetItemRect(m_pCurItem, &rcItem);
        if (::GetCapture() == NULL) {
            const int kDragThreshold = 3; // debounce: click should not trigger line recalculation
            bool bDragging = false;
            SetCapture(m_hWnd);
            ASSERT(m_hWnd == GetCapture());
            AfxLockTempMaps();
@@ -1479,6 +1481,14 @@
                case WM_MOUSEMOVE:
                    ptNew = msg.pt;
                    ::ScreenToClient(m_hWnd, &ptNew);
                    if (!bDragging) {
                        if (abs(ptNew.x - pt.x) >= kDragThreshold || abs(ptNew.y - pt.y) >= kDragThreshold) {
                            bDragging = true;
                        }
                        else {
                            break;
                        }
                    }
                    rcNewItem.left = rcItem.left + (ptNew.x - pt.x);
                    rcNewItem.right = rcItem.right + (ptNew.x - pt.x);
                    rcNewItem.top = rcItem.top + (ptNew.y - pt.y);
@@ -1494,6 +1504,10 @@
                case WM_LBUTTONUP:
                    ptNew = msg.pt;
                    ::ScreenToClient(m_hWnd, &ptNew);
                    if (!bDragging) {
                        ReleaseCapture();
                        goto ExitLoop;
                    }
                    m_pCurItem->rect.left = m_nMagneticLinVer > 0 ? m_nMagneticLinVer : (rcItem.left + (ptNew.x - pt.x) + m_nOffsetX);
                    m_pCurItem->rect.right = m_pCurItem->rect.left + (rcItem.right - rcItem.left);
                    m_pCurItem->rect.top = m_nMagneticLinHoz > 0 ? m_nMagneticLinHoz : (rcItem.top + (ptNew.y - pt.y) + m_nOffsetY);