Skip to content

Commit

Permalink
handle multiple axes with same tag
Browse files Browse the repository at this point in the history
  • Loading branch information
Max Melander committed Oct 3, 2024
1 parent 80d7e26 commit 36023f8
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2320,16 +2320,13 @@ impl<'a> Face<'a> {
return None;
}

if let Some((i, var_axis)) = self
.variation_axes()
.into_iter()
.enumerate()
.find(|(_, var_axis)| var_axis.tag == axis)
{
self.coordinates.data[i] = var_axis.normalized_value(value);
for (i, var_axis) in self.variation_axes().into_iter().enumerate() {
if var_axis.tag == axis {
self.coordinates.data[i] = var_axis.normalized_value(value);

if let Some(avar) = self.tables.avar {
let _ = avar.map_coordinate(self.coordinates.as_mut_slice(), i);
if let Some(avar) = self.tables.avar {
let _ = avar.map_coordinate(self.coordinates.as_mut_slice(), i);
}
}
}

Expand Down

0 comments on commit 36023f8

Please sign in to comment.