| 456 | } |
| 457 | |
| 458 | void EditLineTool::drawImpl(QPainter* painter, MapWidget* widget) |
| 459 | { |
| 460 | auto num_selected_objects = map()->selectedObjects().size(); |
| 461 | if (num_selected_objects > 0) |
| 462 | { |
| 463 | drawSelectionOrPreviewObjects(painter, widget); |
| 464 | |
| 465 | Object* object = *map()->selectedObjectsBegin(); |
| 466 | if (num_selected_objects == 1 && |
| 467 | object->getType() == Object::Text && |
| 468 | !object->asText()->hasSingleAnchor()) |
| 469 | { |
| 470 | drawBoundingPath(painter, widget, object->asText()->controlPoints(), hoveringOverFrame() ? active_color : selection_color); |
| 471 | } |
| 472 | else if (selection_extent.isValid()) |
| 473 | { |
| 474 | drawBoundingBox(painter, widget, selection_extent, hoveringOverFrame() ? active_color : selection_color); |
| 475 | } |
| 476 | |
| 477 | if (num_selected_objects <= max_objects_for_handle_display) |
| 478 | { |
| 479 | for (const auto* object: map()->selectedObjects()) |
| 480 | { |
| 481 | auto hover_point = std::numeric_limits<MapCoordVector::size_type>::max(); |
| 482 | pointHandles().draw(painter, widget, object, hover_point, false, PointHandles::DisabledHandleState); |
| 483 | } |
| 484 | } |
| 485 | |
| 486 | if (!highlight_renderables->empty()) |
| 487 | map()->drawSelection(painter, true, widget, highlight_renderables.data(), true); |
| 488 | } |
| 489 | |
| 490 | // Box selection |
| 491 | if (isDragging() && box_selection) |
| 492 | drawSelectionBox(painter, widget, click_pos_map, cur_pos_map); |
| 493 | } |
| 494 | |
| 495 | void EditLineTool::updatePreviewObjects() |
| 496 | { |
nothing calls this directly
no test coverage detected