     let dimensionForDraggedButton = self.draggedButtonDimension()
 
     let firstButton = firstTool.button
-    let firstButtonMargin = self.draggedOnBarButton == firstButton ? dimensionForDraggedButton : 0
+    let firstButtonMargin = self.draggedOnToolIdx == 0 ? dimensionForDraggedButton : 0
     switch self.location {
     case .top:
       self.layoutConstraints.append(contentsOf: [


  fileprivate func endDrag() {
    self.isDragOngoing = false
    self.draggedOnBarButton = nil
    self.relayout()
  }
}

  fileprivate var layoutConstraints = [NSLayoutConstraint]()

  fileprivate var isDragOngoing = false
  fileprivate var draggedOnToolIdx: Int?
  fileprivate var buttonFrames: [CGRect] = []

  required init?(coder: NSCoder) {
    fatalError("init(coder:) has not been implemented")
