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> {
|
fn resolve_paint<'a>(&self, paint: &'a Paint) -> Cow<'a, Paint> {
|
||||||
if self.transform.is_identity() {
|
let mut must_copy = !self.transform.is_identity();
|
||||||
return Cow::Borrowed(paint);
|
if !must_copy {
|
||||||
}
|
if let Paint::Pattern(ref pattern) = *paint {
|
||||||
if let Paint::Pattern(ref pattern) = *paint {
|
must_copy = !self.image_smoothing_enabled !=
|
||||||
if !self.image_smoothing_enabled ==
|
pattern.flags.contains(PatternFlags::NO_SMOOTHING);
|
||||||
pattern.flags.contains(PatternFlags::NO_SMOOTHING) {
|
|
||||||
return Cow::Borrowed(paint)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if !must_copy {
|
||||||
|
return Cow::Borrowed(paint);
|
||||||
|
}
|
||||||
|
|
||||||
let mut paint = (*paint).clone();
|
let mut paint = (*paint).clone();
|
||||||
paint.apply_transform(&self.transform);
|
paint.apply_transform(&self.transform);
|
||||||
if let Paint::Pattern(ref mut pattern) = paint {
|
if let Paint::Pattern(ref mut pattern) = paint {
|
||||||
|
|
Loading…
Reference in New Issue