Adjusted gradient transform function to be more readable.
This commit is contained in:
parent
a4a1262fa2
commit
fd5e1e5ab0
4 changed files with 25 additions and 28 deletions
|
|
@ -2,7 +2,7 @@
|
|||
mod linear;
|
||||
|
||||
pub use crate::gradient::linear::{Linear, Location, Position};
|
||||
use crate::{Color, Point};
|
||||
use crate::Color;
|
||||
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
/// A fill which transitions colors progressively along a direction, either linearly, radially (TBD),
|
||||
|
|
@ -27,10 +27,4 @@ impl Gradient {
|
|||
pub fn linear(position: impl Into<Position>) -> linear::Builder {
|
||||
linear::Builder::new(position.into())
|
||||
}
|
||||
|
||||
pub(crate) fn coords(&mut self) -> (&mut Point, &mut Point) {
|
||||
match self {
|
||||
Gradient::Linear(gradient) => (&mut gradient.start, &mut gradient.end)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue