Skip to content

Commit

Permalink
Fix error
Browse files Browse the repository at this point in the history
  • Loading branch information
GsLogimaker committed Nov 27, 2024
1 parent 828c1d1 commit 69f2a46
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions gd/rendering/2d/texture2d.gd
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ func _build(b: GFComponentBuilder) -> void:

static func update_texture_rect(sprite:GFTexture2D, item:GFCanvasItem) -> void:
var texture:= sprite.get_texture()

if texture == null:
return

RenderingServer.canvas_item_add_texture_rect(
item.get_rid(),
Rect2(-texture.get_size() / 2, texture.get_size()),
Expand Down

0 comments on commit 69f2a46

Please sign in to comment.