Commit 18400809 authored by Florian Blasius's avatar Florian Blasius 🤘

code cleanup

parent 3c034438
Pipeline #9061 passed with stage
in 3 minutes and 14 seconds
......@@ -44,13 +44,11 @@ pub struct Window {
window_async: bool,
/// Drawing mode
mode: Cell<Mode>,
// /// The inner renderer
// inner: sdl2::render::WindowCanvas,
/// Mouse in relative mode
mouse_relative: bool,
/// Content of the last drop (file | text) operation
drop_content: RefCell<Option<String>>,
/// inner frame buffer
data: Vec<Color>,
/// html canvas that represents the window
canvas: web_sys::HtmlCanvasElement,
......@@ -62,14 +60,6 @@ pub struct Window {
button_state: Rc<RefCell<(bool, bool, bool)>>,
}
// impl Drop for Window {
// fn drop(&mut self) {
// unsafe {
// cleanup();
// }
// }
// }
impl Renderer for Window {
/// Get width
fn width(&self) -> u32 {
......@@ -134,20 +124,7 @@ impl Window {
title: &str,
flags: &[WindowFlag],
) -> Option<Self> {
// match flag {
// WindowFlag::Async => window_async = true,
// WindowFlag::Back => _back = true,
// WindowFlag::Front => _front = true,
// WindowFlag::Borderless => borderless = true,
// WindowFlag::Resizable => resizable = true,
// WindowFlag::Transparent => _transparent = true,
// WindowFlag::Unclosable => _unclosable = true,
// }
// }
// if resizable {
// builder.resizable();
// }
// todo resizable.
// set the window title to document title (browser tab)
if let Ok(document) = document() {
......@@ -368,7 +345,9 @@ impl Window {
pub fn set_mouse_grab(&mut self, grab: bool) {}
/// Set mouse relative mode
pub fn set_mouse_relative(&mut self, relative: bool) {}
pub fn set_mouse_relative(&mut self, relative: bool) {
self.mouse_relative = relative;
}
/// Set position
pub fn set_pos(&mut self, x: i32, y: i32) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment