gfx: Fix a nasty bug whereby the transient clip was not always removed,

causing elements to be randomly clipped out.

Improves Wikipedia, Reddit, etc.
This commit is contained in:
Patrick Walton 2014-12-22 11:34:07 -08:00
parent dea8375613
commit b22b29533a

View file

@ -814,6 +814,12 @@ impl<'a> PaintContext<'a> {
pub fn get_or_create_temporary_draw_target(&mut self, opacity: AzFloat) -> DrawTarget { pub fn get_or_create_temporary_draw_target(&mut self, opacity: AzFloat) -> DrawTarget {
if opacity == 1.0 { if opacity == 1.0 {
// Reuse the draw target, but remove the transient clip. If we don't do the latter,
// we'll be in a state whereby the paint subcontext thinks it has no transient clip
// (see `StackingContext::optimize_and_draw_into_context`) but it actually does,
// resulting in a situation whereby display items are seemingly randomly clipped out.
self.remove_transient_clip_if_applicable();
return self.draw_target.clone() return self.draw_target.clone()
} }