Track lines
This commit is contained in:
@@ -9,7 +9,7 @@ extends Container
|
||||
@export var time_interval: float = 1000.0 # 1 second
|
||||
@export var grid_space_ms: float = 250 # 0.25 seconds
|
||||
@export var label_interval_ms: float = 1000.0 # 1 second
|
||||
@export var line_thickness: int = 1
|
||||
@export var line_thickness: int = 2
|
||||
@export var major_line_step: int = 4
|
||||
@export var cursor_width: int = 8
|
||||
@export var zoom: float = 1.0
|
||||
@@ -76,16 +76,23 @@ func _draw():
|
||||
var start := (time_offset / pixels_per_unit) - 1
|
||||
var end := start + (screen_width / pixels_per_unit) + 2
|
||||
|
||||
# measure lines
|
||||
for t in range(int(start), int(end) + 1):
|
||||
var x := t * pixels_per_unit - time_offset
|
||||
|
||||
if x >= 0 and x <= screen_width:
|
||||
if t % 4 == 0:
|
||||
draw_line(Vector2(x, 28.0), Vector2(x, size.y), primary_color, 2)
|
||||
draw_line(Vector2(x, 28.0), Vector2(x, size.y), primary_color, line_thickness)
|
||||
var time = t * int(time_interval)
|
||||
draw_string(font, Vector2(x - time_label_offset_x, time_label_offset_y), format_time_ms_minutes(time), HORIZONTAL_ALIGNMENT_CENTER, -1, font_size, primary_color)
|
||||
else:
|
||||
draw_line(Vector2(x, 28.0), Vector2(x, timeline_y), secondary_color, 1)
|
||||
draw_line(Vector2(x, 28.0), Vector2(x, timeline_y), secondary_color, line_thickness)
|
||||
pass
|
||||
|
||||
# track lines
|
||||
for t in track_list.get_children():
|
||||
draw_line(Vector2(0.0, t.global_position.y - global_position.y + t.size.y), Vector2(size.x, t.global_position.y - global_position.y + t.size.y), secondary_color, line_thickness)
|
||||
pass
|
||||
|
||||
queue_sort()
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user