Skip to content

Commit

Permalink
more validate_spline_pos
Browse files Browse the repository at this point in the history
  • Loading branch information
mo271 committed Dec 12, 2024
1 parent 7086925 commit f9f55f4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions jxl/src/features/spline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ impl QuantizedSpline {

let px = starting_point.x.round();
let py = starting_point.y.round();
//TODO: validate_spline_point_pos(px, py)?;
validate_spline_point_pos(px, py)?;

let mut current_x = px as i32;
let mut current_y = py as i32;
Expand All @@ -170,7 +170,7 @@ impl QuantizedSpline {
for &(dx, dy) in &self.control_points {
current_delta_x += dx as i32;
current_delta_y += dy as i32;
validate_spline_point_pos(current_delta_x, current_delta_y).unwrap();
validate_spline_point_pos(current_delta_x, current_delta_y)?;

manhattan_distance +=
current_delta_x.unsigned_abs() as u64 + current_delta_y.unsigned_abs() as u64;
Expand All @@ -184,7 +184,7 @@ impl QuantizedSpline {

current_x += current_delta_x;
current_y += current_delta_y;
validate_spline_point_pos(current_x, current_y).unwrap();
validate_spline_point_pos(current_x, current_y)?;

result
.control_points
Expand Down

0 comments on commit f9f55f4

Please sign in to comment.