<commit_before>"
A RTDraggableChildren makes an element draggable. When dragged, children of the elements are also being dragged.
"
Class {
	#name : #RTDraggableChildren,
	#superclass : #RTInteraction,
	#category : #'Roassal2-Core'
}

{ #category : #hooks }
RTDraggableChildren >> initializeElement: element [
	| recursiveDrag set |
	
	set := Set new.
	
	recursiveDrag := [ :elem :ancestor|
		set add: elem.
		elem outgoingEdges do: [ :edge |
			(edge to = ancestor) ifFalse: [
				recursiveDrag value: edge to value: ancestor].
			].
		].
	
	element when: TRMouseDragging do: [ :e |
		recursiveDrag value: e element value: e element. e signalUpdate.
		set do: [ :e1 | e1 translateBy: e step ].
		 ]
	
]<commit_msg>Fix RTDraggableChildren to work with zoom<commit_after>"
A RTDraggableChildren makes an element draggable. When dragged, children of the elements are also being dragged.
"
Class {
	#name : #RTDraggableChildren,
	#superclass : #RTInteraction,
	#category : #'Roassal2-Core'
}

{ #category : #hooks }
RTDraggableChildren >> initializeElement: element [
	| recursiveDrag set |
	
	set := Set new.
	
	recursiveDrag := [ :elem :ancestor|
		set add: elem.
		elem outgoingEdges do: [ :edge |
			(edge to = ancestor) ifFalse: [
				recursiveDrag value: edge to value: ancestor].
			].
		].
	
	element when: TRMouseDragging do: [ :e |
		| d |
		recursiveDrag value: e element value: e element. e signalUpdate.
		d := element view canvas camera distanceFromPixelToSpace: e step.
		set do: [ :e1 | e1 translateBy: d ].
		 ]
	
]
{'fraction_non_alphanumeric': 0.10987573577501634, 'fraction_numerical': 0.003924133420536298, 'mean_word_length': 3.6646341463414633, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4217133', 'n_tokens_mistral': 556, 'n_tokens_neox': 499, 'n_words': 163}