Skip to content

Commit

Permalink
weird behaviour when laying out block heading
Browse files Browse the repository at this point in the history
  • Loading branch information
haenoe committed May 25, 2024
1 parent cf2a02c commit 43be544
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/typst/src/layout/container.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use crate::layout::{
Abs, Axes, Corners, Em, Fr, Fragment, Frame, FrameKind, LayoutMultiple, Length,
Ratio, Regions, Rel, Sides, Size, Spacing, VElem,
};
use crate::util::Numeric;
use crate::util::{Numeric, Scalar};
use crate::visualize::{clip_rect, Paint, Stroke};

/// An inline-level container that sizes content.
Expand Down Expand Up @@ -374,7 +374,7 @@ impl LayoutMultiple for Packed<BlockElem> {
if sizing.x == Smart::Auto {
let pod = Regions::one(size, Axes::splat(false));
let frame = body.measure(engine, styles, pod)?.into_frame();
size.x = frame.width();
size.x = frame.width() + Abs::pt(1.0);
expand.x = true;
}

Expand Down
4 changes: 4 additions & 0 deletions test.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#set heading(numbering: "1.")
#set par(justify: true)

= Theory

0 comments on commit 43be544

Please sign in to comment.