summaryrefslogtreecommitdiffstats
path: root/font/src/ft/fc/mod.rs
diff options
context:
space:
mode:
authorChristian Duerr <contact@christianduerr.com>2020-03-07 22:17:38 +0000
committerGitHub <noreply@github.com>2020-03-07 22:17:38 +0000
commit64a3115648d354731ef08c2de8b2168b9326b7b5 (patch)
treec9121ed2e475ed2b531d8f8a1c01d9f000d74769 /font/src/ft/fc/mod.rs
parentde5d770416eb6ea5567b2b46874b8e35b084b9e1 (diff)
Fix selection with invisible start and end
This resolves an issue with the selection clamping, where no selection would be rendered at all when the start was above the viewport while the end was below it.
Diffstat (limited to 'font/src/ft/fc/mod.rs')
-rw-r--r--font/src/ft/fc/mod.rs34
1 files changed, 16 insertions, 18 deletions
diff --git a/font/src/ft/fc/mod.rs b/font/src/ft/fc/mod.rs
index cfcac4aa..ecb056f7 100644
--- a/font/src/ft/fc/mod.rs
+++ b/font/src/ft/fc/mod.rs
@@ -155,18 +155,17 @@ pub enum Width {
impl Width {
fn to_isize(self) -> isize {
- use self::Width::*;
match self {
- Ultracondensed => 50,
- Extracondensed => 63,
- Condensed => 75,
- Semicondensed => 87,
- Normal => 100,
- Semiexpanded => 113,
- Expanded => 125,
- Extraexpanded => 150,
- Ultraexpanded => 200,
- Other(value) => value as isize,
+ Width::Ultracondensed => 50,
+ Width::Extracondensed => 63,
+ Width::Condensed => 75,
+ Width::Semicondensed => 87,
+ Width::Normal => 100,
+ Width::Semiexpanded => 113,
+ Width::Expanded => 125,
+ Width::Extraexpanded => 150,
+ Width::Ultraexpanded => 200,
+ Width::Other(value) => value as isize,
}
}
}
@@ -214,14 +213,13 @@ impl Rgba {
impl fmt::Display for Rgba {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
- use self::Rgba::*;
f.write_str(match *self {
- Unknown => "unknown",
- Rgb => "rgb",
- Bgr => "bgr",
- Vrgb => "vrgb",
- Vbgr => "vbgr",
- None => "none",
+ Rgba::Unknown => "unknown",
+ Rgba::Rgb => "rgb",
+ Rgba::Bgr => "bgr",
+ Rgba::Vrgb => "vrgb",
+ Rgba::Vbgr => "vbgr",
+ Rgba::None => "none",
})
}
}