matt123p / TinyCAD

Open Source circuit capture program
119 stars 26 forks source link

Keep aspect ratio #32

Closed tikonen closed 3 years ago

tikonen commented 3 years ago

Maintains the original aspect ratio on Ctrl-corner drag.

matt123p commented 3 years ago

From your comment it seems that you only want to hold the aspect ratio when the user presses the "Ctrl" key. However, I don't see the code to detect "Ctrl" key pressed?

tikonen commented 3 years ago

Aspect ratio is enforced in CDrawEditItem::Move() only if a Ctrl-key is pressed while dragging.

    // Is the control key down?
    if (GetAsyncKeyState(VK_CONTROL) < 0 && m_pDesign->GetSingleSelectedItem()->CanControlAspect())
    {
        // Ctrl key pressed, so force the movement to be
        // in a fixed aspect ratio way
        switch (EditMethodText)
        {
            // Tracker movement...
        case CRectTracker::hitBottomLeft: