mirror of
https://github.com/servo/servo.git
synced 2025-08-05 05:30:08 +01:00
Implement Pattern::is_zero_size_gradient
There are probably other times where this would be true but I'll worry about that later
This commit is contained in:
parent
93f1053b0e
commit
0a878da500
1 changed files with 11 additions and 2 deletions
|
@ -91,8 +91,17 @@ impl<'a> CanvasPaintState<'a> {
|
||||||
|
|
||||||
impl Pattern<'_> {
|
impl Pattern<'_> {
|
||||||
pub fn is_zero_size_gradient(&self) -> bool {
|
pub fn is_zero_size_gradient(&self) -> bool {
|
||||||
match *self {
|
match self {
|
||||||
Pattern::Raqote(_) => unimplemented!(),
|
Pattern::Raqote(p) => {
|
||||||
|
use raqote::Source::*;
|
||||||
|
|
||||||
|
match p {
|
||||||
|
LinearGradient(g, ..) | RadialGradient(g, ..) | TwoCircleRadialGradient(g, ..) => {
|
||||||
|
g.stops.is_empty()
|
||||||
|
},
|
||||||
|
_ => false
|
||||||
|
}
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pub fn as_raqote(&self) -> &raqote::Source {
|
pub fn as_raqote(&self) -> &raqote::Source {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue