Fix reached macOS UI primitives and audio fade behavior
This commit is contained in:
@@ -177,6 +177,22 @@ func _draw() -> void:
|
||||
used = _segment(used, RID())
|
||||
plain = true
|
||||
RenderingServer.canvas_item_add_rect(_segments[used - 1], visible, color)
|
||||
elif command["kind"] == "gradient_bar":
|
||||
var visible := Rect2(p1, p2 - p1).intersection(clip)
|
||||
if visible.has_area():
|
||||
if not plain:
|
||||
used = _segment(used, RID())
|
||||
plain = true
|
||||
var bottom_argb: int = command["end_argb"]
|
||||
var bottom := Color8((bottom_argb >> 16) & 255, (bottom_argb >> 8) & 255,
|
||||
bottom_argb & 255, (bottom_argb >> 24) & 255)
|
||||
var top_factor := (visible.position.y - p1.y) / (p2.y - p1.y)
|
||||
var bottom_factor := (visible.end.y - p1.y) / (p2.y - p1.y)
|
||||
RenderingServer.canvas_item_add_polygon(_segments[used - 1],
|
||||
PackedVector2Array([visible.position, Vector2(visible.end.x, visible.position.y),
|
||||
visible.end, Vector2(visible.position.x, visible.end.y)]),
|
||||
PackedColorArray([color.lerp(bottom, top_factor), color.lerp(bottom, top_factor),
|
||||
color.lerp(bottom, bottom_factor), color.lerp(bottom, bottom_factor)]))
|
||||
elif command["kind"] == "line":
|
||||
var segment := _clip_line(p1, p2, clip)
|
||||
if segment.size() == 2:
|
||||
|
||||
Reference in New Issue
Block a user