diff --git a/src/Autoload/DrawingAlgos.gd b/src/Autoload/DrawingAlgos.gd index f4493f438..233a18226 100644 --- a/src/Autoload/DrawingAlgos.gd +++ b/src/Autoload/DrawingAlgos.gd @@ -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 diff --git a/src/UI/Dialogs/ImageEffects/RotateImage.gd b/src/UI/Dialogs/ImageEffects/RotateImage.gd index 2a77f86bc..48fb07913 100644 --- a/src/UI/Dialogs/ImageEffects/RotateImage.gd +++ b/src/UI/Dialogs/ImageEffects/RotateImage.gd @@ -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() diff --git a/src/UI/Dialogs/ImageEffects/ScaleImage.gd b/src/UI/Dialogs/ImageEffects/ScaleImage.gd index 72c9cd123..a59276a21 100644 --- a/src/UI/Dialogs/ImageEffects/ScaleImage.gd +++ b/src/UI/Dialogs/ImageEffects/ScaleImage.gd @@ -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