Skip to content

Commit

Permalink
fix empty crop
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyjor committed Aug 19, 2024
1 parent 5fee647 commit 51bd7c1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/editor/JulGameEditor/Components/ComponentInputs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,10 @@ function show_sprite_fields(sprite, animation_window_dict)
end
CImGui.Button("Load Image") && (Component.load_image(sprite, currentTextInTextBox))
elseif fieldString == "crop"
if sprite.crop === nothing || sprite.crop == C_NULL
sprite.crop = JulGame.Math.Vector4(0,0,0,0)
end

crop_x, crop_y, crop_w, crop_h = sprite.crop.x, sprite.crop.y, sprite.crop.z, sprite.crop.t

points = Ref(Vector{ImVec2}([ImVec2(crop_x, crop_y), ImVec2(crop_x + crop_w, crop_y + crop_h)]))
Expand Down

0 comments on commit 51bd7c1

Please sign in to comment.