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

Method updateConstrainedPositions

src/tools/tool_base.cpp:636–656  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

634
635
636void MapEditorToolBase::updateConstrainedPositions()
637{
638 if (snap_helper->getFilter() != SnappingToolHelper::NoSnapping)
639 {
640 SnappingToolHelperSnapInfo info;
641 constrained_pos_map = MapCoordF(snap_helper->snapToObject(cur_pos_map, cur_map_widget, &info, snap_exclude_object));
642 constrained_pos = cur_map_widget->mapToViewport(constrained_pos_map);
643 snapped_to_pos = info.type != SnappingToolHelper::NoSnapping;
644 }
645 else
646 {
647 constrained_pos_map = cur_pos_map;
648 constrained_pos = cur_pos;
649 snapped_to_pos = false;
650 }
651
652 if (angle_helper->isActive())
653 {
654 angle_helper->getConstrainedCursorPositions(constrained_pos_map, constrained_pos_map, constrained_pos, cur_map_widget);
655 }
656}
657
658
659#ifdef MAPPER_DEVELOPMENT_BUILD

Callers

nothing calls this directly

Calls 6

getFilterMethod · 0.80
snapToObjectMethod · 0.80
mapToViewportMethod · 0.80
MapCoordFClass · 0.70
isActiveMethod · 0.45

Tested by

no test coverage detected