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

Method dragMove

src/tools/edit_line_tool.cpp:277–306  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

275}
276
277void EditLineTool::dragMove()
278{
279 if (editingInProgress())
280 {
281 if (snapped_to_pos && handle_offset != MapCoordF(0, 0))
282 {
283 // Snapped to a position. Correct the handle offset, so the
284 // object moves to this position exactly.
285 click_pos_map += handle_offset;
286 object_mover->setStartPos(click_pos_map);
287 handle_offset = MapCoordF(0, 0);
288 }
289
290 qint32 dx, dy;
291 object_mover->move(constrained_pos_map, ObjectMover::HandleOpMode::Never, &dx, &dy);
292 if (highlight_object)
293 {
294 highlight_renderables->removeRenderablesOfObject(highlight_object, false);
295 highlight_object->move(dx, dy);
296 highlight_object->update();
297 highlight_renderables->insertRenderablesOfObject(highlight_object);
298 }
299
300 updatePreviewObjectsAsynchronously();
301 }
302 else if (box_selection)
303 {
304 updateDirtyRect();
305 }
306}
307
308void EditLineTool::dragFinish()
309{

Callers

nothing calls this directly

Calls 6

setStartPosMethod · 0.80
MapCoordFClass · 0.70
moveMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected