MCPcopy Create free account
hub / github.com/OpenOrienteering/mapper / drawImpl

Method drawImpl

src/tools/edit_line_tool.cpp:458–493  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

456}
457
458void 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
495void EditLineTool::updatePreviewObjects()
496{

Callers

nothing calls this directly

Calls 11

selectedObjectsBeginMethod · 0.80
hasSingleAnchorMethod · 0.80
controlPointsMethod · 0.80
drawSelectionMethod · 0.80
sizeMethod · 0.45
getTypeMethod · 0.45
asTextMethod · 0.45
isValidMethod · 0.45
drawMethod · 0.45
emptyMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected