mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-01-18 17:19:50 +00:00
Use getters to lazy-load cleanEdge and OmniScale shaders
This commit is contained in:
parent
66ea1fcfe9
commit
22ddc96962
|
@ -4,8 +4,16 @@ enum GradientDirection { TOP, BOTTOM, LEFT, RIGHT }
|
|||
## Continuation from Image.Interpolation
|
||||
enum Interpolation { SCALE3X = 5, CLEANEDGE = 6, OMNISCALE = 7 }
|
||||
var blend_layers_shader := preload("res://src/Shaders/BlendLayers.gdshader")
|
||||
var clean_edge_shader: Shader
|
||||
var omniscale_shader := preload("res://src/Shaders/Effects/Rotation/OmniScale.gdshader")
|
||||
var clean_edge_shader: Shader:
|
||||
get:
|
||||
if clean_edge_shader == null:
|
||||
clean_edge_shader = load("res://src/Shaders/Effects/Rotation/cleanEdge.gdshader")
|
||||
return clean_edge_shader
|
||||
var omniscale_shader: Shader:
|
||||
get:
|
||||
if omniscale_shader == null:
|
||||
omniscale_shader = load("res://src/Shaders/Effects/Rotation/OmniScale.gdshader")
|
||||
return omniscale_shader
|
||||
|
||||
|
||||
## Blends canvas layers into passed image starting from the origin position
|
||||
|
|
|
@ -33,10 +33,6 @@ func _ready() -> void:
|
|||
|
||||
|
||||
func _about_to_popup() -> void:
|
||||
if DrawingAlgos.clean_edge_shader == null:
|
||||
DrawingAlgos.clean_edge_shader = load(
|
||||
"res://src/Shaders/Effects/Rotation/cleanEdge.gdshader"
|
||||
)
|
||||
drag_pivot = false
|
||||
if pivot == Vector2.INF:
|
||||
_calculate_pivot()
|
||||
|
|
|
@ -22,10 +22,6 @@ func _ready() -> void:
|
|||
|
||||
|
||||
func _on_ScaleImage_about_to_show() -> void:
|
||||
if DrawingAlgos.clean_edge_shader == null:
|
||||
DrawingAlgos.clean_edge_shader = load(
|
||||
"res://src/Shaders/Effects/Rotation/cleanEdge.gdshader"
|
||||
)
|
||||
Global.canvas.selection.transform_content_confirm()
|
||||
aspect_ratio = float(Global.current_project.size.x) / float(Global.current_project.size.y)
|
||||
width_value.value = Global.current_project.size.x
|
||||
|
|
Loading…
Reference in a new issue