Checkpoint

This commit is contained in:
Antonio Scandurra
2023-10-03 16:53:49 +02:00
parent e49b411205
commit 8a58733d91
4 changed files with 52 additions and 14 deletions
+26 -3
View File
@@ -1,10 +1,12 @@
use crate::{
black, point, px, Bounds, FontId, Hsla, Layout, Pixels, Point, RasterizedGlyphId, RunStyle,
ShapedBoundary, ShapedLine, ShapedRun, UnderlineStyle, WindowContext,
black, point, px, Bounds, FontId, Hsla, Layout, MonochromeSprite, Pixels, Point,
RasterizedGlyphId, RunStyle, ShapedBoundary, ShapedLine, ShapedRun, UnderlineStyle,
WindowContext,
};
use anyhow::Result;
use smallvec::SmallVec;
use std::sync::Arc;
use util::ResultExt;
#[derive(Default, Debug, Clone)]
pub struct Line {
@@ -174,7 +176,28 @@ impl Line {
// origin: glyph_origin,
// });
} else {
todo!()
if let Some((tile, bounds)) = cx
.rasterize_glyph(
run.font_id,
glyph.id,
self.layout.font_size,
cx.scale_factor(),
glyph_origin,
)
.log_err()
{
let layer_id = cx.current_layer_id();
cx.scene().insert(
layer_id,
MonochromeSprite {
order: layout.order,
bounds,
color,
tile,
},
);
}
// cx.scene().insert(Symbol {
// order: layout.order,
// origin,