aboutsummaryrefslogtreecommitdiff
path: root/src/math
diff options
context:
space:
mode:
authorArne Dußin2020-11-20 23:41:46 +0100
committerArne Dußin2020-11-20 23:41:46 +0100
commitbff1955c38480f2dffd0a10c16ef46dc11320752 (patch)
treee69403752aa05f22b5474ef07997092c65dc694e /src/math
parentd6a0708b995b6c0e12ed8890c678c180f859de51 (diff)
downloadgraf_karto-bff1955c38480f2dffd0a10c16ef46dc11320752.tar.gz
graf_karto-bff1955c38480f2dffd0a10c16ef46dc11320752.zip
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.
Diffstat (limited to 'src/math')
-rw-r--r--src/math/polygon.rs3
1 files changed, 2 insertions, 1 deletions
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<T: Scalar + Copy> {
pub corners: Vec<Vec2<T>>,