diff --git a/source/rafcon/gui/mygaphas/aspect.py b/source/rafcon/gui/mygaphas/aspect.py
index <HASH>..<HASH> 100644
--- a/source/rafcon/gui/mygaphas/aspect.py
+++ b/source/rafcon/gui/mygaphas/aspect.py
@@ -188,7 +188,10 @@ class SegmentHandleSelection(ItemHandleSelection):
         after = handles[handle_index + 1]
         d, p = distance_line_point(before.pos, after.pos, handle.pos)
 
-        if d < 1. / item.hierarchy_level:
+        # Checks how far the waypoint is from an imaginary line connecting the previous and next way/end point
+        # If it is close, the two segments are merged to one
+        merge_distance = item.line_width * 4
+        if d < merge_distance:
             assert len(self.view.canvas.solver._marked_cons) == 0
             Segment(item, self.view).merge_segment(segment)
fix(SegmentHandleSelection): Properly merge segments

The merging of segments (removal of waypoints) should now properly work
on all zoom and hierarchy levels. The commit fixes the issues, where it
was no longer possible to create new waypoints on a deeply nested state.