mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2025-12-23 10:11:54 +00:00
Tweaks, crash fixes and a few new nodes
This commit is contained in:
parent
0c3cae2ba5
commit
914360551f
5 changed files with 602 additions and 24 deletions
|
|
@ -77,8 +77,8 @@ impl Bezier {
|
|||
pub(crate) fn t_value_to_parametric(&self, t: TValue) -> f64 {
|
||||
match t {
|
||||
TValue::Parametric(t) => {
|
||||
assert!((0.0..=1.).contains(&t));
|
||||
t
|
||||
// Clamp the t value to the valid range [0.0, 1.0]
|
||||
t.clamp(0.0, 1.0)
|
||||
}
|
||||
TValue::Euclidean(t) => {
|
||||
assert!((0.0..=1.).contains(&t));
|
||||
|
|
|
|||
|
|
@ -212,7 +212,8 @@ impl<PointId: crate::Identifier> Subpath<PointId> {
|
|||
(segment_index, t)
|
||||
}
|
||||
SubpathTValue::GlobalParametric(global_t) => {
|
||||
assert!((0.0..=1.).contains(&global_t));
|
||||
// Clamp global_t to the valid range [0, 1] instead of asserting
|
||||
let global_t = global_t.clamp(0.0, 1.0);
|
||||
|
||||
if global_t == 1. {
|
||||
return (self.len_segments() - 1, 1.);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue