summaryrefslogtreecommitdiff
path: root/src/library
diff options
context:
space:
mode:
Diffstat (limited to 'src/library')
-rw-r--r--src/library/elements.rs11
-rw-r--r--src/library/mod.rs2
-rw-r--r--src/library/text.rs6
3 files changed, 9 insertions, 10 deletions
diff --git a/src/library/elements.rs b/src/library/elements.rs
index 5271788f..c57504fb 100644
--- a/src/library/elements.rs
+++ b/src/library/elements.rs
@@ -3,9 +3,8 @@ use std::f64::consts::SQRT_2;
use decorum::N64;
use super::*;
-use crate::color::Color;
use crate::layout::{
- BackgroundNode, BackgroundShape, Fill, FixedNode, ImageNode, PadNode,
+ BackgroundNode, BackgroundShape, FixedNode, ImageNode, PadNode, Paint,
};
/// `image`: An image.
@@ -64,10 +63,10 @@ fn rect_impl(
let fixed = FixedNode { width, height, child: stack.into() };
- if let Some(color) = fill {
+ if let Some(fill) = fill {
ctx.push_into_par(BackgroundNode {
shape: BackgroundShape::Rect,
- fill: Fill::Color(color),
+ fill: Paint::Color(fill),
child: fixed.into(),
});
} else {
@@ -120,10 +119,10 @@ fn ellipse_impl(
.into(),
};
- if let Some(color) = fill {
+ if let Some(fill) = fill {
ctx.push_into_par(BackgroundNode {
shape: BackgroundShape::Ellipse,
- fill: Fill::Color(color),
+ fill: Paint::Color(fill),
child: fixed.into(),
});
} else {
diff --git a/src/library/mod.rs b/src/library/mod.rs
index 92ee9faa..abc9ff5f 100644
--- a/src/library/mod.rs
+++ b/src/library/mod.rs
@@ -16,7 +16,7 @@ pub use utility::*;
use std::fmt::{self, Display, Formatter};
use std::rc::Rc;
-use crate::color::RgbaColor;
+use crate::color::{Color, RgbaColor};
use crate::eval::{EvalContext, FuncArgs, Scope, TemplateValue, Value};
use crate::exec::{Exec, FontFamily};
use crate::font::{FontStyle, FontWeight, VerticalFontMetric};
diff --git a/src/library/text.rs b/src/library/text.rs
index 9c2863bc..e1fff9f3 100644
--- a/src/library/text.rs
+++ b/src/library/text.rs
@@ -1,6 +1,6 @@
use crate::exec::{FontState, LineState};
use crate::font::{FontStretch, FontStyle, FontWeight};
-use crate::layout::Fill;
+use crate::layout::Paint;
use super::*;
@@ -57,7 +57,7 @@ pub fn font(ctx: &mut EvalContext, args: &mut FuncArgs) -> Value {
}
if let Some(fill) = fill {
- font.fill = Fill::Color(fill);
+ font.fill = Paint::Color(fill);
}
if let Some(FamilyDef(serif)) = &serif {
@@ -244,7 +244,7 @@ fn line_impl(
// Suppress any existing strikethrough if strength is explicitly zero.
let state = thickness.map_or(true, |s| !s.is_zero()).then(|| {
Rc::new(LineState {
- stroke: stroke.map(Fill::Color),
+ stroke: stroke.map(Paint::Color),
thickness,
offset,
extent,