From bff1955c38480f2dffd0a10c16ef46dc11320752 Mon Sep 17 00:00:00 2001 From: Arne Dußin Date: Fri, 20 Nov 2020 23:41:46 +0100 Subject: Add unfinished polygon room tool When adding the polygon room tool, a problem with drawing polygons arised. Drawing a simple, but nonregular polygon is not something that is supported by raylib, so further additions to the math library are needed. --- src/math/polygon.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/math') diff --git a/src/math/polygon.rs b/src/math/polygon.rs index 5711049..5cf8104 100644 --- a/src/math/polygon.rs +++ b/src/math/polygon.rs @@ -1,9 +1,10 @@ use super::{PolygonGraph, Vec2}; use nalgebra::{ClosedDiv, ClosedMul, ClosedSub, RealField, Scalar}; use num_traits::Zero; +use serde::{Deserialize, Serialize}; use std::ops::Neg; -#[derive(Debug)] +#[derive(Debug, Deserialize, Serialize, PartialEq)] // TODO: Support polygons with holes pub struct Polygon { pub corners: Vec>, -- cgit v1.2.3-70-g09d2