Make the primitive shape tools avoid setting a negative transform scale (#1973)

* Fix transformation for primitive tools, make odd-sided polygons and stars flipped with radius instead of scale

* Extract to function and add comment

* Code review

---------

Co-authored-by: hypercube <0hypercube@gmail.com>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
Mohamed Osama 2024-09-15 02:15:56 +03:00 committed by GitHub
parent 426f3b2cb4
commit 0c5bccc2fd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 44 additions and 4 deletions

View file

@ -194,6 +194,13 @@ impl TaggedValue {
_ => panic!("Cannot convert to primitive string"),
}
}
pub fn to_u32(&self) -> u32 {
match self {
TaggedValue::U32(x) => *x,
_ => panic!("Passed value is not of type u32"),
}
}
}
impl Display for TaggedValue {