MCPcopy Create free account
hub / github.com/GeoDaCenter/geoda / OnSizingEndDragLeft

Method OnSizingEndDragLeft

ogl/basic2.cpp:1526–1570  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1524}
1525
1526void wxShape::OnSizingEndDragLeft(wxControlPoint* pt, double WXUNUSED(x), double WXUNUSED(y), int WXUNUSED(keys), int WXUNUSED(attachment))
1527{
1528 wxClientDC dc(GetCanvas());
1529 GetCanvas()->PrepareDC(dc);
1530
1531 m_canvas->ReleaseMouse();
1532 dc.SetLogicalFunction(wxCOPY);
1533 this->Recompute();
1534 this->ResetControlPoints();
1535
1536 this->Erase(dc);
1537/*
1538 if (!pt->m_eraseObject)
1539 this->Show(false);
1540*/
1541
1542 this->SetSize(pt->sm_controlPointDragEndWidth, pt->sm_controlPointDragEndHeight);
1543
1544 // The next operation could destroy this control point (it does for label objects,
1545 // via formatting the text), so save all values we're going to use, or
1546 // we'll be accessing garbage.
1547 wxShape *theObject = this;
1548 wxShapeCanvas *theCanvas = m_canvas;
1549 bool eraseIt = pt->m_eraseObject;
1550
1551 if (theObject->GetCentreResize())
1552 theObject->Move(dc, theObject->GetX(), theObject->GetY());
1553 else
1554 theObject->Move(dc, pt->sm_controlPointDragPosX, pt->sm_controlPointDragPosY);
1555
1556/*
1557 if (!eraseIt)
1558 theObject->Show(true);
1559*/
1560
1561 // Recursively redraw links if we have a composite.
1562 if (theObject->GetChildren().GetCount() > 0)
1563 theObject->DrawLinks(dc, -1, true);
1564
1565 double width, height;
1566 theObject->GetBoundingBoxMax(&width, &height);
1567 theObject->GetEventHandler()->OnEndSize(width, height);
1568
1569 if (!theCanvas->GetQuickEditMode() && eraseIt) theCanvas->Redraw(dc);
1570}
1571
1572
1573

Callers 1

OnEndDragLeftMethod · 0.45

Calls 15

ResetControlPointsMethod · 0.95
EraseMethod · 0.95
SetSizeMethod · 0.95
ResetControlPointsMethod · 0.95
SetSizeFunction · 0.85
RecomputeMethod · 0.80
MoveMethod · 0.80
DrawLinksMethod · 0.80
GetBoundingBoxMaxMethod · 0.80
OnEndSizeMethod · 0.80
GetQuickEditModeMethod · 0.80
CalculateBoundingBoxMethod · 0.80

Tested by

no test coverage detected