Checkpoint: Glyphs rendering how I'd like

This commit is contained in:
Nathan Sobo
2023-10-03 17:29:36 -06:00
parent 550d9a9f71
commit c57e19c8fa
6 changed files with 8 additions and 14 deletions
@@ -49,7 +49,6 @@ const SHADERS_METALLIB: &[u8] = include_bytes!(concat!(env!("OUT_DIR"), "/shader
const INSTANCE_BUFFER_SIZE: usize = 8192 * 1024; // This is an arbitrary decision. There's probably a more optimal value.
pub struct MetalRenderer {
device: metal::Device,
layer: metal::MetalLayer,
command_queue: CommandQueue,
quads_pipeline_state: metal::RenderPipelineState,
@@ -145,7 +144,6 @@ impl MetalRenderer {
));
Self {
device,
layer,
command_queue,
quads_pipeline_state,
+4 -4
View File
@@ -192,14 +192,14 @@ impl<'a, 'w> WindowContext<'a, 'w> {
let raster_bounds = self.text_system().raster_bounds(&params)?;
if !raster_bounds.is_zero() {
let layer_id = self.current_layer_id();
let bounds = Bounds {
origin: glyph_origin.map(|px| px.floor()) + raster_bounds.origin.map(Into::into),
size: raster_bounds.size.map(Into::into),
};
let tile = self
.window
.glyph_atlas
.get_or_insert_with(&params, &mut || self.text_system().rasterize_glyph(&params))?;
let bounds = Bounds {
origin: glyph_origin.map(|px| px.floor()) + raster_bounds.origin.map(Into::into),
size: tile.bounds.size.map(Into::into),
};
self.window.scene.insert(
layer_id,