mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-23 13:48:11 +08:00
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:
committed by
Keavon Chambers
parent
29e00e488b
commit
4c3c925c2c
@@ -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 {
|
||||
|
||||
@@ -95,7 +95,7 @@ pub enum Operation {
|
||||
path: Vec<LayerId>,
|
||||
insert_index: isize,
|
||||
transform: [f64; 6],
|
||||
sides: u8,
|
||||
sides: u32,
|
||||
style: style::PathStyle,
|
||||
},
|
||||
AddOverlayShape {
|
||||
|
||||
Reference in New Issue
Block a user