| 2448 | } |
| 2449 | |
| 2450 | void wxShape::ResetControlPoints() |
| 2451 | { |
| 2452 | ResetMandatoryControlPoints(); |
| 2453 | |
| 2454 | if (m_controlPoints.GetCount() < 1) |
| 2455 | return; |
| 2456 | |
| 2457 | double maxX, maxY, minX, minY; |
| 2458 | |
| 2459 | GetBoundingBoxMax(&maxX, &maxY); |
| 2460 | GetBoundingBoxMin(&minX, &minY); |
| 2461 | |
| 2462 | double widthMin = (double)(minX + CONTROL_POINT_SIZE + 2); |
| 2463 | double heightMin = (double)(minY + CONTROL_POINT_SIZE + 2); |
| 2464 | |
| 2465 | // Offsets from main object |
| 2466 | double top = (double)(- (heightMin / 2.0)); |
| 2467 | double bottom = (double)(heightMin / 2.0 + (maxY - minY)); |
| 2468 | double left = (double)(- (widthMin / 2.0)); |
| 2469 | double right = (double)(widthMin / 2.0 + (maxX - minX)); |
| 2470 | |
| 2471 | wxNode *node = m_controlPoints.GetFirst(); |
| 2472 | wxControlPoint *control = (wxControlPoint *)node->GetData(); |
| 2473 | control->m_xoffset = left; control->m_yoffset = top; |
| 2474 | |
| 2475 | node = node->GetNext(); control = (wxControlPoint *)node->GetData(); |
| 2476 | control->m_xoffset = 0; control->m_yoffset = top; |
| 2477 | |
| 2478 | node = node->GetNext(); control = (wxControlPoint *)node->GetData(); |
| 2479 | control->m_xoffset = right; control->m_yoffset = top; |
| 2480 | |
| 2481 | node = node->GetNext(); control = (wxControlPoint *)node->GetData(); |
| 2482 | control->m_xoffset = right; control->m_yoffset = 0; |
| 2483 | |
| 2484 | node = node->GetNext(); control = (wxControlPoint *)node->GetData(); |
| 2485 | control->m_xoffset = right; control->m_yoffset = bottom; |
| 2486 | |
| 2487 | node = node->GetNext(); control = (wxControlPoint *)node->GetData(); |
| 2488 | control->m_xoffset = 0; control->m_yoffset = bottom; |
| 2489 | |
| 2490 | node = node->GetNext(); control = (wxControlPoint *)node->GetData(); |
| 2491 | control->m_xoffset = left; control->m_yoffset = bottom; |
| 2492 | |
| 2493 | node = node->GetNext(); control = (wxControlPoint *)node->GetData(); |
| 2494 | control->m_xoffset = left; control->m_yoffset = 0; |
| 2495 | } |
| 2496 | |
| 2497 | void wxShape::DeleteControlPoints(wxDC *dc) |
| 2498 | { |