mirror of
https://github.com/kaesaecracker/servicepoint-simulator.git
synced 2025-01-18 10:30:14 +01:00
cargo fmt
This commit is contained in:
parent
69502ac3fb
commit
e3d80204a6
|
@ -2,7 +2,7 @@ use std::sync::{RwLock, RwLockWriteGuard};
|
||||||
|
|
||||||
use log::{debug, error, info, warn};
|
use log::{debug, error, info, warn};
|
||||||
use servicepoint2::{
|
use servicepoint2::{
|
||||||
ByteGrid, Command, Origin, PIXEL_COUNT, PIXEL_WIDTH, PixelGrid, TILE_SIZE,
|
ByteGrid, Command, Origin, PixelGrid, PIXEL_COUNT, PIXEL_WIDTH, TILE_SIZE,
|
||||||
};
|
};
|
||||||
|
|
||||||
use crate::font::BitmapFont;
|
use crate::font::BitmapFont;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
use font_kit::canvas::*;
|
use font_kit::canvas::{Canvas, Format, RasterizationOptions};
|
||||||
use font_kit::hinting::HintingOptions;
|
use font_kit::hinting::HintingOptions;
|
||||||
use pathfinder_geometry::transform2d::Transform2F;
|
use pathfinder_geometry::transform2d::Transform2F;
|
||||||
use pathfinder_geometry::vector::{vec2f, vec2i};
|
use pathfinder_geometry::vector::{vec2f, vec2i};
|
||||||
|
@ -36,7 +36,7 @@ impl BitmapFont {
|
||||||
HintingOptions::None,
|
HintingOptions::None,
|
||||||
RasterizationOptions::GrayscaleAa,
|
RasterizationOptions::GrayscaleAa,
|
||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
assert_eq!(canvas.pixels.len(), 64);
|
assert_eq!(canvas.pixels.len(), 64);
|
||||||
assert_eq!(canvas.stride, 8);
|
assert_eq!(canvas.stride, 8);
|
||||||
|
|
10
src/gui.rs
10
src/gui.rs
|
@ -2,10 +2,10 @@ use std::sync::mpsc::Sender;
|
||||||
use std::sync::RwLock;
|
use std::sync::RwLock;
|
||||||
|
|
||||||
use log::{info, warn};
|
use log::{info, warn};
|
||||||
use pixels::{Pixels, PixelsBuilder, SurfaceTexture};
|
|
||||||
use pixels::wgpu::TextureFormat;
|
use pixels::wgpu::TextureFormat;
|
||||||
|
use pixels::{Pixels, PixelsBuilder, SurfaceTexture};
|
||||||
use servicepoint2::{
|
use servicepoint2::{
|
||||||
ByteGrid, PIXEL_HEIGHT, PIXEL_WIDTH, PixelGrid, TILE_SIZE,
|
ByteGrid, PixelGrid, PIXEL_HEIGHT, PIXEL_WIDTH, TILE_SIZE,
|
||||||
};
|
};
|
||||||
use winit::application::ApplicationHandler;
|
use winit::application::ApplicationHandler;
|
||||||
use winit::dpi::{LogicalSize, Size};
|
use winit::dpi::{LogicalSize, Size};
|
||||||
|
@ -77,9 +77,9 @@ impl ApplicationHandler<AppEvents> for App<'_> {
|
||||||
&window,
|
&window,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
.render_texture_format(TextureFormat::Bgra8UnormSrgb)
|
.render_texture_format(TextureFormat::Bgra8UnormSrgb)
|
||||||
.build()
|
.build()
|
||||||
.expect("could not create pixels")
|
.expect("could not create pixels")
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ use std::time::Duration;
|
||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
use log::{info, warn};
|
use log::{info, warn};
|
||||||
use servicepoint2::{
|
use servicepoint2::{
|
||||||
ByteGrid, Command, PIXEL_HEIGHT, PIXEL_WIDTH, PixelGrid, TILE_HEIGHT,
|
ByteGrid, Command, PixelGrid, PIXEL_HEIGHT, PIXEL_WIDTH, TILE_HEIGHT,
|
||||||
TILE_WIDTH,
|
TILE_WIDTH,
|
||||||
};
|
};
|
||||||
use winit::event_loop::{ControlFlow, EventLoop};
|
use winit::event_loop::{ControlFlow, EventLoop};
|
||||||
|
|
Loading…
Reference in a new issue