aboutsummaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
Diffstat (limited to 'src/map')
-rw-r--r--src/map/polygon_room.rs5
-rw-r--r--src/map/rect_room.rs2
2 files changed, 4 insertions, 3 deletions
diff --git a/src/map/polygon_room.rs b/src/map/polygon_room.rs
index a57f5e4..2a29436 100644
--- a/src/map/polygon_room.rs
+++ b/src/map/polygon_room.rs
@@ -6,6 +6,7 @@ use crate::colours::DEFAULT_COLOURS;
use crate::math::{self, Polygon, Rect, Triangle};
use crate::transform::Transform;
use crate::transformable::NonRigidTransformable;
+use crate::FLOAT_MARGIN;
use nalgebra::{Matrix3, Point2};
use raylib::drawing::{RaylibDraw, RaylibDrawHandle};
use std::ops::Deref;
@@ -26,7 +27,7 @@ impl PolygonRoom {
pub fn from_data(data: PolygonRoomData) -> Self {
Self {
data: data.clone(),
- triangulated: math::triangulate(data),
+ triangulated: math::triangulate(data, FLOAT_MARGIN),
selected: false,
}
}
@@ -34,7 +35,7 @@ impl PolygonRoom {
// When the internal polygon changes, it must be retriangulated to be drawn on the screen
// properly, so this function must be called any time that happens.
fn retriangulate(&mut self) {
- self.triangulated = math::triangulate(self.data.clone());
+ self.triangulated = math::triangulate(self.data.clone(), FLOAT_MARGIN);
}
}
diff --git a/src/map/rect_room.rs b/src/map/rect_room.rs
index 6ed3ed6..ae10327 100644
--- a/src/map/rect_room.rs
+++ b/src/map/rect_room.rs
@@ -49,7 +49,7 @@ impl Mappable for RectRoom {
}
fn bounding_rect(&self) -> Rect<f64> {
- self.data.clone()
+ self.data
}
}