in src/main/kotlin/com/jetbrains/interactiveRebase/listeners/CircleDragAndDropListener.kt [153:180]
override fun mouseReleased(e: MouseEvent) {
val modelService = project.service<ModelService>()
if (wasDragged) {
commit.isDragged = false
circles.forEachIndexed { index, circle ->
circle.colorTheme = circlesThemes[index]
circle.commit.isHovered = false
circle.repaint()
}
if (squashIntoIndex != -1) {
modelService.addToSelectedCommits(circle.commit, parent.branch)
modelService.addToSelectedCommits(circles[squashIntoIndex].commit, parent.branch)
project.service<ActionService>().takeFixupAction()
} else if (initialIndex != currentIndex) {
repositionOnDrop()
// mark false to stop refreshing too many times while dropping
// mark false to stop refreshing too many times while dropping
(parent.parent as GraphPanel?)?.markRefreshedAsTrue()
modelService.markCommitAsReordered(commit, initialIndex, currentIndex)
parent.branch.updateCurrentCommits(initialIndex, currentIndex, commit)
}
// call an explicit refresh
(parent.parent as GraphPanel?)?.markRefreshedAsFalse()
(parent.parent as GraphPanel?)?.updateGraphPanel()
(parent.parent as GraphPanel?)?.repaint()
}
e.consume()
}