diff options
| author | Laurenz <laurmaedje@gmail.com> | 2021-03-27 21:52:39 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2021-03-27 21:52:39 +0100 |
| commit | 57ca9628c14378e8816a8a1f1530ae69c2269907 (patch) | |
| tree | 01c4dfa7be25047b3f50fc7a186b03d2cd3394b7 /src/library/image.rs | |
| parent | 76fc4cca62f5b955200b2c62cc85b69eea491ece (diff) | |
Better space coalescing logic 🌧
This creates a smaller state machine helper type for softness coalescing, which does not own the resulting nodes. While this creates a bit more duplication in stack and par builder, it makes it a lot easier to integrate additional logic into the paragraph builder.
Furthermore:
- Line breaks are now "hard", that is, not coalesced with each other.
- Text nodes with equal style are now merged allowing for example `f{}i` to form a ligature.
Diffstat (limited to 'src/library/image.rs')
| -rw-r--r-- | src/library/image.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/library/image.rs b/src/library/image.rs index 020f7d50..ed7b2268 100644 --- a/src/library/image.rs +++ b/src/library/image.rs @@ -23,7 +23,7 @@ pub fn image(ctx: &mut EvalContext, args: &mut FuncArgs) -> Value { let loaded = ctx.env.resources.load(&path.v, ImageResource::parse); if let Some((res, img)) = loaded { let dimensions = img.buf.dimensions(); - ctx.push_into_par(ImageNode { res, dimensions, width, height }); + ctx.push(ImageNode { res, dimensions, width, height }); } else { ctx.diag(error!(path.span, "failed to load image")); } |
