summaryrefslogtreecommitdiff
path: root/src/library/math
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2022-09-20 13:05:55 +0200
committerLaurenz <laurmaedje@gmail.com>2022-09-20 16:37:15 +0200
commit757a701c1aa2a6fb80033c7e75666661818da6f9 (patch)
tree0415fec94d3856f4ebc97a1744cf2ba75fe8e7aa /src/library/math
parente29f55bb294cc298daad97accf6d8a76976b409c (diff)
A New World
Diffstat (limited to 'src/library/math')
-rw-r--r--src/library/math/mod.rs6
-rw-r--r--src/library/math/rex.rs7
2 files changed, 6 insertions, 7 deletions
diff --git a/src/library/math/mod.rs b/src/library/math/mod.rs
index 81593c4f..ed98ab1c 100644
--- a/src/library/math/mod.rs
+++ b/src/library/math/mod.rs
@@ -28,7 +28,7 @@ impl MathNode {
#[property(resolve, shorthand(around))]
pub const BELOW: Option<BlockSpacing> = Some(Ratio::one().into());
- fn construct(_: &mut Machine, args: &mut Args) -> TypResult<Content> {
+ fn construct(_: &mut Vm, args: &mut Args) -> TypResult<Content> {
Ok(Content::show(Self {
formula: args.expect("formula")?,
display: args.named("display")?.unwrap_or(false),
@@ -48,7 +48,7 @@ impl Show for MathNode {
}
}
- fn realize(&self, _: &mut Context, styles: StyleChain) -> TypResult<Content> {
+ fn realize(&self, _: &dyn World, styles: StyleChain) -> TypResult<Content> {
let node = self::rex::RexNode {
tex: self.formula.clone(),
display: self.display,
@@ -64,7 +64,7 @@ impl Show for MathNode {
fn finalize(
&self,
- _: &mut Context,
+ _: &dyn World,
styles: StyleChain,
mut realized: Content,
) -> TypResult<Content> {
diff --git a/src/library/math/rex.rs b/src/library/math/rex.rs
index 0116b4b2..7bfdeb7a 100644
--- a/src/library/math/rex.rs
+++ b/src/library/math/rex.rs
@@ -22,17 +22,16 @@ pub struct RexNode {
impl Layout for RexNode {
fn layout(
&self,
- ctx: &mut Context,
+ world: &dyn World,
_: &Regions,
styles: StyleChain,
) -> TypResult<Vec<Frame>> {
// Load the font.
let span = self.tex.span;
- let font = ctx
- .loader
+ let font = world
.book()
.select(self.family.as_str(), variant(styles))
- .and_then(|id| ctx.loader.font(id).ok())
+ .and_then(|id| world.font(id).ok())
.ok_or("failed to find math font")
.at(span)?;