Fix polygon overflow (#644)

* changed polygon side to u32 + set max polygon side to 1000

* revert unnecessary change

* Include unwrap for vertices input
This commit is contained in:
Thomas Cheng
2022-05-20 16:40:01 -04:00
committed by Keavon Chambers
parent 29e00e488b
commit 4c3c925c2c
3 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -105,7 +105,7 @@ impl ShapeLayer {
///
/// # Panics
/// This function panics if `sides` is zero.
pub fn ngon(sides: u8, style: PathStyle) -> Self {
pub fn ngon(sides: u32, style: PathStyle) -> Self {
use std::f64::consts::{FRAC_PI_2, TAU};
fn unit_rotation(theta: f64) -> DVec2 {
+1 -1
View File
@@ -95,7 +95,7 @@ pub enum Operation {
path: Vec<LayerId>,
insert_index: isize,
transform: [f64; 6],
sides: u8,
sides: u32,
style: style::PathStyle,
},
AddOverlayShape {