extends SummerDayTool
class_name SummerDayPenCanvasTool


func _init():
	priority = 1


func _check_for_use(event: InputEvent, tool_context: SummerDayToolContext):
	if event is InputEventMouseButton:
		if event.button_index == BUTTON_LEFT and event.is_pressed():
			return true
	
	if event is InputEventMouseMotion:
		return true


func _run(event: InputEvent, tool_context: SummerDayToolContext):
	if tool_context.edited_document:
		var transformed_event = event.xformed_by(
			tool_context.canvas_state.inverse_view_transform
			)
		for track in tool_context.edited_document.tracks:
			track.pass_local_input(transformed_event)
