1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-02-20 12:33:14 +00:00

Angle between last drawn pixel and line is now appearing on the top when drawing a straight line

Also straight lines work with LightenDarken now, and moved the Seconds Timeline a bit to the left
This commit is contained in:
OverloadedOrama 2019-12-19 03:15:23 +02:00
parent 3cf44a6d55
commit 91b21a52f5
3 changed files with 9 additions and 2 deletions

View file

@ -226,6 +226,7 @@ text = "[64×64]"
align = 2
[node name="UI" type="HBoxContainer" parent="MenuAndUI"]
editor/display_folded = true
margin_top = 28.0
margin_right = 1152.0
margin_bottom = 648.0
@ -804,6 +805,7 @@ size_flags_horizontal = 3
size_flags_vertical = 3
[node name="ViewportAndRulers" type="VBoxContainer" parent="MenuAndUI/UI/CanvasAndTimeline/HViewportContainer"]
editor/display_folded = true
margin_right = 704.0
margin_bottom = 478.0
size_flags_horizontal = 3
@ -883,6 +885,7 @@ margin_right = 319.0
margin_bottom = 464.0
[node name="ViewportContainer2" type="ViewportContainer" parent="MenuAndUI/UI/CanvasAndTimeline/HViewportContainer"]
editor/display_folded = true
visible = false
margin_left = 345.0
margin_right = 686.0

View file

@ -248,7 +248,7 @@ func _process(delta : float) -> void:
Global.right_color_picker.color = pixel_color
Global.update_right_custom_brush()
if Input.is_action_just_pressed("shift") and (["Pencil", "Eraser"].has(Global.current_left_tool) or ["Pencil", "Eraser"].has(Global.current_right_tool)):
if Input.is_action_just_pressed("shift") and (["Pencil", "Eraser", "LightenDarken"].has(Global.current_left_tool) or ["Pencil", "Eraser", "LightenDarken"].has(Global.current_right_tool)):
line_2d = Line2D.new()
line_2d.width = 0.5
line_2d.default_color = Color.darkgray
@ -262,6 +262,10 @@ func _process(delta : float) -> void:
line_2d.queue_free()
if is_making_line:
line_2d.set_point_position(1, mouse_pos)
var angle := stepify(rad2deg(line_2d.points[1].angle_to_point(line_2d.points[0])), 0.01)
if angle < 0:
angle = 360 + angle
Global.cursor_position_label.text += " %s°" % str(angle)
if is_making_selection != "None": #If we're making a selection

View file

@ -21,7 +21,7 @@ func _draw() -> void:
var minor_subdivide := Transform2D()
var fps = Global.control.fps
var horizontal_scroll = get_parent().get_node("FrameAndButtonContainer").get_node("ScrollContainer").scroll_horizontal
var starting_pos := Vector2(26, 26)
var starting_pos := Vector2(10, 10)
transform.x = Vector2(fps, fps) / 2.52
transform.origin = starting_pos - Vector2(horizontal_scroll, horizontal_scroll)