aboutsummaryrefslogtreecommitdiff
path: root/src/tool/polygon_room_tool.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/tool/polygon_room_tool.rs')
-rw-r--r--src/tool/polygon_room_tool.rs30
1 files changed, 5 insertions, 25 deletions
diff --git a/src/tool/polygon_room_tool.rs b/src/tool/polygon_room_tool.rs
index 4f8edce..1b079d2 100644
--- a/src/tool/polygon_room_tool.rs
+++ b/src/tool/polygon_room_tool.rs
@@ -2,8 +2,8 @@ use super::Tool;
use crate::map::Map;
use crate::math::{self, Polygon, PolygonError, Vec2};
use crate::transform::Transform;
+use crate::colours::DEFAULT_COLOURS;
use raylib::core::drawing::{RaylibDraw, RaylibDrawHandle};
-use raylib::ffi::Color;
struct UnfinishedPolygon {
pub corners: Vec<Vec2<f64>>,
@@ -103,12 +103,7 @@ impl Tool for PolygonRoomTool {
transform.point_m_to_px(&polygon.corners[0]),
transform.point_m_to_px(&polygon.working_corner),
transform.length_m_to_px(0.1) as f32,
- Color {
- r: 150,
- g: 200,
- b: 150,
- a: 255,
- },
+ DEFAULT_COLOURS.room_selected
);
} else if polygon.corners.len() == 2 {
// We have three valid corners, so we can draw a triangle.
@@ -116,12 +111,7 @@ impl Tool for PolygonRoomTool {
transform.point_m_to_px(&polygon.corners[0]),
transform.point_m_to_px(&polygon.corners[1]),
transform.point_m_to_px(&polygon.working_corner),
- Color {
- r: 150,
- g: 200,
- b: 150,
- a: 255,
- },
+ DEFAULT_COLOURS.room_selected
)
} else {
// A proper polygon can be drawn.
@@ -136,12 +126,7 @@ impl Tool for PolygonRoomTool {
transform.point_m_to_px(&triangle[0]),
transform.point_m_to_px(&triangle[1]),
transform.point_m_to_px(&triangle[2]),
- Color {
- r: 150,
- g: 200,
- b: 150,
- a: 255,
- },
+ DEFAULT_COLOURS.room_selected
)
}
} else if polygon.check_validity_completed().is_ok() {
@@ -153,12 +138,7 @@ impl Tool for PolygonRoomTool {
transform.point_m_to_px(&triangle[0]),
transform.point_m_to_px(&triangle[1]),
transform.point_m_to_px(&triangle[2]),
- Color {
- r: 150,
- g: 200,
- b: 150,
- a: 255,
- },
+ DEFAULT_COLOURS.room_selected
)
}
}