summaryrefslogtreecommitdiff
path: root/src/library/text.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2022-01-05 14:49:14 +0100
committerLaurenz <laurmaedje@gmail.com>2022-01-05 15:06:42 +0100
commitf7e8624b4cf31744d600167dd7f3a9d9d1626014 (patch)
tree0941c8db497befc47a666d3d1384db4ab9fc5133 /src/library/text.rs
parent4c81a5d43eabd959dbb500a8076f99f21bd037bd (diff)
Refactor
Diffstat (limited to 'src/library/text.rs')
-rw-r--r--src/library/text.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/library/text.rs b/src/library/text.rs
index 5fa19cb9..486cb77f 100644
--- a/src/library/text.rs
+++ b/src/library/text.rs
@@ -9,7 +9,6 @@ use rustybuzz::{Feature, UnicodeBuffer};
use ttf_parser::Tag;
use super::prelude::*;
-use super::LinkNode;
use crate::font::{
Face, FaceId, FontStore, FontStretch, FontStyle, FontVariant, FontWeight,
VerticalFontMetric,
@@ -59,6 +58,8 @@ impl TextNode {
/// Decorative lines.
#[fold(|a, b| a.into_iter().chain(b).collect())]
pub const LINES: Vec<LineDecoration> = vec![];
+ /// An URL the text should link to.
+ pub const LINK: Option<String> = None;
/// The size of the glyphs.
#[fold(Linear::compose)]
@@ -889,7 +890,7 @@ impl<'a> ShapedText<'a> {
}
// Apply link if it exists.
- if let Some(url) = self.styles.get_ref(LinkNode::URL) {
+ if let Some(url) = self.styles.get_ref(TextNode::LINK) {
frame.link(url);
}