You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: circle_drawer.rs
    path of file: ./repos/vizia/examples/7GUIs
    
    the code of the file until where you have to start completion: use vizia::prelude::*;
use vizia::vg::{Paint, Path};

const STYLE: &str = r#"
    :root {
        child-space: 10px;
    }

    .header {
        left: 1s;
        right: 1s;
        col-between: 5px;
    }

    circle-drawer {
        row-between: 10px;
    }

    circle-drawer-canvas {
        border-color: black;
        border-width: 2px;
    }

    .dialog-box {
        child-space: 1s;
        width: 460px;
        height: 100px;
        space: 1s;
        bottom: 40px;
        background-color: rgba(255, 255, 255, 0.7);
        border: 1px black;
        border-radius: 10%;
    }

    .dialog-box vstack {
        child-space: 1s;
        row-between: 15px;
    }

    .dialog-box vstack slider {
        width: 400px;
    }
"#;

fn distance(x1: f32, y1: f32, x2: f32, y2: f32) -> f32 {
    f32::sqrt(f32::powf(x1 - x2, 2.0) + f32::powf(y1 - y2, 2.0))
}

#[derive(Clone, Copy, Data)]
struct Circle {
    x
    
    fn event(&mut self, cx: &mut EventContext, event: &mut Event) {
        if let Some(event) = event.take() {
            match event {
                CircleDrawerEvent::AddCircle(x, y) => {
                    let circle = Circle { x, y, r: 26.0 };
                    self.circles_data.add_circle(circle);
                    self.undo_redo.add_action(UndoRedoAction::Circle(circle));
                }
                CircleDrawerEvent::TrySelectCircle(x, y) => {
                    if !(self.dialog_open || self.menu_open) {
                        self.circles_data.update_selected(x, y)
                    }
                }
                CircleDrawerEvent::ChangeRadius(r) => self.circles_data.change_radius(r),
                CircleDrawerEvent::Undo => self.undo_redo.undo(&mut self.circles_data.circles),
                CircleDrawerEvent::Redo => self.undo_redo.redo(&mut self.circles_data.circles),
                CircleDrawerEvent::ToggleRightMenu => {
                    if !self.menu_open && self.circles_data.selected.is_some() {
                        let (x, y) = cx.mouse().right.pos_down;

                        self.menu_open = true;
                        self.menu_posx = Pixels(x);
                        self.menu_posy = Pixels(y);
                    } else {
                        self.menu_open = false;
                    }

                    if !self.dialog_open {
                        let x = cx.mouse().cursorx;
                        let y = cx.mouse().cursory;

                        self.circles_data.update_selected(x, y);
                    }
                }
                CircleDrawerEvent::ToggleDialog => {
                    self.dialog_open ^= true;

                    let radius = self.circles_data.get_selected_radius().unwrap();

                    if self.dialog_open {
                        // if dialog just opened save the current radius as before radius
                        self.radius_before = radius;
                    } else {
                        if self.radius_before != radius {
                            self.undo_redo.add_action(UndoRedoAction::RadiusChange(
                                self.circles_data.selected.unwrap(),
                                self.radius_before,
                            ));
                        }

                        let x = cx.mouse().cursorx;
                        let y = cx.mouse().cursory;

                        self.circles_data.update_selected(x, y);
                    }
                }
            }
        }
    }