diff --git a/gfx/layers/wr/WebRenderCommandBuilder.cpp b/gfx/layers/wr/WebRenderCommandBuilder.cpp index 27185fd83a31..44fa7c59fbaf 100644 --- a/gfx/layers/wr/WebRenderCommandBuilder.cpp +++ b/gfx/layers/wr/WebRenderCommandBuilder.cpp @@ -1609,9 +1609,9 @@ WebRenderCommandBuilder::GenerateFallbackData(nsDisplayItem* aItem, // Some display item may draw exceed the paintSize, we need prepare a larger // draw target to contain the result. - auto scaledBounds = bounds * LayoutDeviceToLayerScale(1); - scaledBounds.Scale(scale.width, scale.height); - LayerIntSize dtSize = RoundedToInt(scaledBounds).Size(); + auto scaledPaintSize = bounds.Size() * LayoutDeviceToLayerScale(1); + scaledPaintSize.Scale(scale.width, scale.height); + LayerIntSize dtSize = RoundedToInt(scaledPaintSize); bool needPaint = true; LayoutDeviceIntPoint offset = RoundedToInt(bounds.TopLeft());