summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--crates/typst-library/src/layout/par.rs4
-rw-r--r--tests/ref/layout/page-binding.pngbin17255 -> 16919 bytes
2 files changed, 2 insertions, 2 deletions
diff --git a/crates/typst-library/src/layout/par.rs b/crates/typst-library/src/layout/par.rs
index e28e661c..01ccf127 100644
--- a/crates/typst-library/src/layout/par.rs
+++ b/crates/typst-library/src/layout/par.rs
@@ -903,7 +903,7 @@ fn linebreak_optimized<'a>(vt: &Vt, p: &'a Preparation<'a>, width: Abs) -> Vec<L
// Cost parameters.
const HYPH_COST: Cost = 0.5;
const RUNT_COST: Cost = 0.5;
- const CONSECUTIVE_DASH_COST: Cost = 300.0;
+ const CONSECUTIVE_DASH_COST: Cost = 0.3;
const MAX_COST: Cost = 1_000_000.0;
const MIN_RATIO: f64 = -1.0;
@@ -993,7 +993,7 @@ fn linebreak_optimized<'a>(vt: &Vt, p: &'a Preparation<'a>, width: Abs) -> Vec<L
// In Knuth paper, cost = (1 + 100|r|^3 + p)^2 + a,
// where r is the ratio, p=50 is the penalty, and a=3000 is consecutive the penalty.
// We divide the whole formula by 10, resulting (0.01 + |r|^3 + p)^2 + a,
- // where p=0.5 and a=300
+ // where p=0.5 and a=0.3
cost = (0.01 + cost).powi(2);
// Penalize two consecutive dashes (not necessarily hyphens) extra.
diff --git a/tests/ref/layout/page-binding.png b/tests/ref/layout/page-binding.png
index 59d73fa4..5b6d0657 100644
--- a/tests/ref/layout/page-binding.png
+++ b/tests/ref/layout/page-binding.png
Binary files differ