Fix image pattern texture atlas logic.
This commit is contained in:
parent
a1f0ae097a
commit
cf78ac4569
|
@ -448,16 +448,18 @@ impl State {
|
|||
}
|
||||
|
||||
fn resolve_paint<'a>(&self, paint: &'a Paint) -> Cow<'a, Paint> {
|
||||
if self.transform.is_identity() {
|
||||
return Cow::Borrowed(paint);
|
||||
}
|
||||
let mut must_copy = !self.transform.is_identity();
|
||||
if !must_copy {
|
||||
if let Paint::Pattern(ref pattern) = *paint {
|
||||
if !self.image_smoothing_enabled ==
|
||||
pattern.flags.contains(PatternFlags::NO_SMOOTHING) {
|
||||
return Cow::Borrowed(paint)
|
||||
must_copy = !self.image_smoothing_enabled !=
|
||||
pattern.flags.contains(PatternFlags::NO_SMOOTHING);
|
||||
}
|
||||
}
|
||||
|
||||
if !must_copy {
|
||||
return Cow::Borrowed(paint);
|
||||
}
|
||||
|
||||
let mut paint = (*paint).clone();
|
||||
paint.apply_transform(&self.transform);
|
||||
if let Paint::Pattern(ref mut pattern) = paint {
|
||||
|
|
Loading…
Reference in New Issue