We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5cbb73d commit 007b964Copy full SHA for 007b964
lorien/InfiniteCanvas/Tools/RectangleTool.gd
@@ -36,6 +36,10 @@ func _make_rectangle(pressure: float) -> void:
36
pressure = pressure_curve.sample(pressure)
37
38
var bottom_right_point := _cursor.global_position
39
+ # draw a square if Shift is pressed
40
+ if Input.is_key_pressed(KEY_SHIFT):
41
+ var drag_dir := _cursor.global_position - _start_position_top_left
42
+ bottom_right_point = _start_position_top_left + drag_dir.project(sign(drag_dir))
43
var height := bottom_right_point.y - _start_position_top_left.y
44
var width := bottom_right_point.x - _start_position_top_left.x
45
var top_right_point := _start_position_top_left + Vector2(width, 0)
0 commit comments