mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +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<'_> {
|
||||
pub fn is_zero_size_gradient(&self) -> bool {
|
||||
match *self {
|
||||
Pattern::Raqote(_) => unimplemented!(),
|
||||
match self {
|
||||
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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue