Changeset a57af18 in git


Ignore:
Timestamp:
14/01/14 03:34:17 (6 years ago)
Author:
Olly Betts <olly@…>
Branches:
line_contents, master, stereo, travis-osx
Children:
e0f3ade
Parents:
d9cd8ae
Message:

src/guicontrol.cc: Fix assertion if two mouse buttons are held down
at the same time. Reported by Brian Clipstone.

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • ChangeLog

    rd9cd8ae ra57af18  
     1Tue Jan 14 03:33:38 GMT 2014  Olly Betts <olly@survex.com>
     2
     3        * src/guicontrol.cc: Fix assertion if two mouse buttons are held down
     4          at the same time.  Reported by Brian Clipstone.
     5
    16Tue Jan 14 03:22:54 GMT 2014  Olly Betts <olly@survex.com>
    27
  • src/guicontrol.cc

    rd9cd8ae ra57af18  
    316316{
    317317    if (m_View->HasData()) {
    318         dragging = LEFT_DRAG;
    319 
    320318        m_DragStart = m_DragRealStart = event.GetPosition();
    321319
     
    329327            if (event.ControlDown()) {
    330328                if (m_View->IsExtendedElevation()) {
    331                     dragging = NO_DRAG;
    332329                    return;
    333330                }
     
    341338        }
    342339
     340        // We need to release and recapture for the cursor to update (noticed
     341        // with wxGTK).
     342        if (dragging != NO_DRAG) m_View->ReleaseMouse();
    343343        m_View->CaptureMouse();
     344
     345        dragging = LEFT_DRAG;
    344346    }
    345347}
     
    348350{
    349351    if (m_View->HasData()) {
    350         if (dragging == NO_DRAG)
     352        if (dragging != LEFT_DRAG)
    351353            return;
    352354
     
    362364        dragging = NO_DRAG;
    363365
    364         m_View->DragFinished();
     366        m_View->DragFinished();
    365367
    366368        if (event.GetPosition() == m_DragRealStart) {
     
    375377{
    376378    if (m_View->HasData() && !m_View->IsExtendedElevation()) {
     379        m_DragStart = event.GetPosition();
     380
     381        m_View->SetCursor(GfxCore::CURSOR_ROTATE_VERTICALLY);
     382
     383        // We need to release and recapture for the cursor to update (noticed
     384        // with wxGTK).
     385        if (dragging != NO_DRAG) m_View->ReleaseMouse();
     386        m_View->CaptureMouse();
    377387        dragging = MIDDLE_DRAG;
    378         m_DragStart = event.GetPosition();
    379 
    380         m_View->SetCursor(GfxCore::CURSOR_ROTATE_VERTICALLY);
    381 
    382         m_View->CaptureMouse();
    383388    }
    384389}
     
    387392{
    388393    if (m_View->HasData()) {
     394        if (dragging != MIDDLE_DRAG)
     395            return;
     396
    389397        dragging = NO_DRAG;
    390398        m_View->ReleaseMouse();
    391         m_View->DragFinished();
    392 
    393         RestoreCursor();
     399        m_View->DragFinished();
     400
     401        RestoreCursor();
    394402    }
    395403}
     
    403411        m_DragStart = event.GetPosition();
    404412
     413        m_View->SetCursor(GfxCore::CURSOR_DRAGGING_HAND);
     414
     415        // We need to release and recapture for the cursor to update (noticed
     416        // with wxGTK).
     417        if (dragging != NO_DRAG) m_View->ReleaseMouse();
     418        m_View->CaptureMouse();
    405419        dragging = RIGHT_DRAG;
    406 
    407         m_View->SetCursor(GfxCore::CURSOR_DRAGGING_HAND);
    408         m_View->CaptureMouse();
    409420    }
    410421}
     
    412423void GUIControl::OnRButtonUp(wxMouseEvent&)
    413424{
     425    if (dragging != RIGHT_DRAG)
     426        return;
     427
    414428    m_LastDrag = drag_NONE;
    415429    m_View->ReleaseMouse();
Note: See TracChangeset for help on using the changeset viewer.