Skip to content

Commit

Permalink
Prefer Math::sqrt in ImageBlender::stamp_rect
Browse files Browse the repository at this point in the history
Using Godot's math is recommended as it may provide the same functionality across platforms.
  • Loading branch information
Xrayez committed Jul 2, 2020
1 parent 9d81b97 commit f034ca7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/image/image_blender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ void ImageBlender::stamp_rect(const Ref<Image> p_src, const Rect2 &p_src_rect, R
float delta_x = end_point.x - start_point.x;
float delta_y = end_point.y - start_point.y;

float distance = sqrt(delta_x * delta_x + delta_y * delta_y);
float distance = Math::sqrt(delta_x * delta_x + delta_y * delta_y);

float step_x = 0.0;
float step_y = 0.0;
Expand Down

0 comments on commit f034ca7

Please sign in to comment.