Fixed a problem in aspect ratio code of Image node
This commit is contained in:
parent
c942014124
commit
0f51e1f0f8
|
@ -37,8 +37,9 @@ func get_filetime(file_path : String) -> int:
|
|||
|
||||
func get_adjusted_uv(uv : String) -> String:
|
||||
if get_parameter("fix_ar"):
|
||||
var ar : float = texture.get_height()
|
||||
ar /= texture.get_width()
|
||||
var ar : float = 1.0
|
||||
if texture.get_width() != 0 and texture.get_height() != 0:
|
||||
ar = texture.get_width() / texture.get_width()
|
||||
uv = "((%s) - vec2(0.0, %f)) * vec2(1.0, %f)" % [uv, (1-ar)/2, 1/ar]
|
||||
|
||||
if get_parameter("clamp"):
|
||||
|
|
Loading…
Reference in New Issue