Skip to content

Commit 22bf751

Browse files
committed
// TODO: HEXAGONS
1 parent 5bd83f3 commit 22bf751

File tree

3 files changed

+6
-14
lines changed

3 files changed

+6
-14
lines changed

src/main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ pub(crate) enum Mode {
2727
Path,
2828
}
2929

30+
// TODO: HEXAGONS
3031
// FIX: path from 6 to 18 is wrong, there exist a much shorter one (point 10 seems to cause that somehow)
3132
#[macroquad::main(window_configuration)]
3233
async fn main()

src/ui.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ use macroquad::time::get_fps;
88
// TODO: make option to switch to hexagons for points
99
// TODO: edit colour with hex values
1010
// TODO: make colours editable
11+
// TODO: HEXAGONS
1112

1213
pub(crate) fn paint_ui(
1314
mode: &mut Mode,

src/utils.rs

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,12 @@ use macroquad::{
33
prelude::{
44
mouse_position, Color,
55
},
6-
shapes::{draw_circle, draw_rectangle, draw_circle_lines, draw_line, draw_triangle}, text::{get_text_center, draw_text, measure_text}, math::{Vec4, Vec2}, color::{YELLOW, BLACK, MAGENTA, GREEN, RED},
6+
shapes::{draw_circle, draw_rectangle, draw_circle_lines, draw_line, draw_triangle, draw_hexagon}, text::{get_text_center, draw_text, measure_text}, math::{Vec4, Vec2}, color::{YELLOW, BLACK, MAGENTA, GREEN, RED},
77
};
88
use std::ops::{Div, Mul};
99
use crate::Mode;
1010

11-
// TODO: rework everything
12-
// TODO: make points drawable as hexagons
11+
// TODO: HEXAGONS
1312

1413
pub(crate) fn is_point_in_circle(
1514
point_x: f32, point_y: f32,
@@ -68,7 +67,6 @@ pub(crate) fn handle_mouse_input(
6867
)
6968
{
7069
// --- MOVE ---
71-
// FIX: delete line
7270

7371
// Select a point to be moved around
7472
(Move, true, _, _, false, Some(hovered_point_id), _) =>
@@ -258,15 +256,8 @@ fn paint_points(
258256
.for_each(|(id, point)|
259257
{
260258
// Drawing the points
261-
draw_circle(
262-
point.x,
263-
point.y,
264-
*radius,
265-
if Some(id) == *selected_point_id_option
266-
{ YELLOW }
267-
else
268-
{ Color::from_hex(*point_color) }
269-
);
259+
draw_circle(point.x, point.y, *radius, if Some(id) == *selected_point_id_option { YELLOW } else { Color::from_hex(*point_color) });
260+
// draw_hexagon(point.x, point.y, *radius, 1.5, true, Color::from_hex(0xffffff), Color::from_hex(*point_color));
270261

271262
let text_center = get_text_center(id.to_string().as_str(), None, 20, 1.0, 0.0);
272263

@@ -297,7 +288,6 @@ fn paint_points(
297288
*hovered_point_id_option = None;
298289
}
299290

300-
// FIX: draw arrow heads properly
301291
fn paint_arrow_heads(
302292
graph: &DijkstraGraph,
303293
radius: &f32,

0 commit comments

Comments
 (0)