Commit 3e468fad authored by Alex Butler's avatar Alex Butler

Remove arrayvec from rusttype-dev

parent c42baaae
......@@ -9,7 +9,6 @@ publish = false
rusttype = { path = "../", features = ["gpu_cache"] }
glium = "0.26"
image = { version = "0.23", default-features = false, features = ["png"] }
arrayvec = { version = "0.5", default-features = false }
once_cell = "1"
blake2 = "0.8"
criterion = "0.3"
......
......@@ -196,55 +196,52 @@ You can also try resizing this window."
let origin = point(0.0, 0.0);
let vertices: Vec<Vertex> = glyphs
.iter()
.flat_map(|g| {
if let Ok(Some((uv_rect, screen_rect))) = cache.rect_for(0, g) {
let gl_rect = Rect {
min: origin
+ (vector(
screen_rect.min.x as f32 / screen_width - 0.5,
1.0 - screen_rect.min.y as f32 / screen_height - 0.5,
)) * 2.0,
max: origin
+ (vector(
screen_rect.max.x as f32 / screen_width - 0.5,
1.0 - screen_rect.max.y as f32 / screen_height - 0.5,
)) * 2.0,
};
arrayvec::ArrayVec::<[Vertex; 6]>::from([
Vertex {
position: [gl_rect.min.x, gl_rect.max.y],
tex_coords: [uv_rect.min.x, uv_rect.max.y],
colour,
},
Vertex {
position: [gl_rect.min.x, gl_rect.min.y],
tex_coords: [uv_rect.min.x, uv_rect.min.y],
colour,
},
Vertex {
position: [gl_rect.max.x, gl_rect.min.y],
tex_coords: [uv_rect.max.x, uv_rect.min.y],
colour,
},
Vertex {
position: [gl_rect.max.x, gl_rect.min.y],
tex_coords: [uv_rect.max.x, uv_rect.min.y],
colour,
},
Vertex {
position: [gl_rect.max.x, gl_rect.max.y],
tex_coords: [uv_rect.max.x, uv_rect.max.y],
colour,
},
Vertex {
position: [gl_rect.min.x, gl_rect.max.y],
tex_coords: [uv_rect.min.x, uv_rect.max.y],
colour,
},
])
} else {
arrayvec::ArrayVec::new()
}
.filter_map(|g| cache.rect_for(0, g).ok().flatten())
.flat_map(|(uv_rect, screen_rect)| {
let gl_rect = Rect {
min: origin
+ (vector(
screen_rect.min.x as f32 / screen_width - 0.5,
1.0 - screen_rect.min.y as f32 / screen_height - 0.5,
)) * 2.0,
max: origin
+ (vector(
screen_rect.max.x as f32 / screen_width - 0.5,
1.0 - screen_rect.max.y as f32 / screen_height - 0.5,
)) * 2.0,
};
vec![
Vertex {
position: [gl_rect.min.x, gl_rect.max.y],
tex_coords: [uv_rect.min.x, uv_rect.max.y],
colour,
},
Vertex {
position: [gl_rect.min.x, gl_rect.min.y],
tex_coords: [uv_rect.min.x, uv_rect.min.y],
colour,
},
Vertex {
position: [gl_rect.max.x, gl_rect.min.y],
tex_coords: [uv_rect.max.x, uv_rect.min.y],
colour,
},
Vertex {
position: [gl_rect.max.x, gl_rect.min.y],
tex_coords: [uv_rect.max.x, uv_rect.min.y],
colour,
},
Vertex {
position: [gl_rect.max.x, gl_rect.max.y],
tex_coords: [uv_rect.max.x, uv_rect.max.y],
colour,
},
Vertex {
position: [gl_rect.min.x, gl_rect.max.y],
tex_coords: [uv_rect.min.x, uv_rect.max.y],
colour,
},
]
})
.collect();
......
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