Bug 1805022 - Do round_out() surface_rect before translating in <CompositeState>::get_surface_rect. r=gw

For example, given that
  `surface_rect`: `Box2D((0.0, -1.04904175e-5), (588.99994, 0.0))`
  `surface bound`: Box2D((0.0, -512.0), (1024.0, 0.0))

Then doing round_out() after translating the surface_rect with
`-surface_bounds.min.to_vector()` results an empty rect.

We need to make sure that negative origin `surface_rect` is not collapssed.

Differential Revision: https://phabricator.services.mozilla.com/D166887
This commit is contained in:
Hiroyuki Ikezoe 2023-01-16 21:15:46 +00:00
Родитель a17d4b8e52
Коммит fe1a1cef01
1 изменённых файлов: 1 добавлений и 0 удалений

Просмотреть файл

@ -592,6 +592,7 @@ impl CompositeState {
let surface_rect = transform.local_to_surface.map_rect(&local_sub_rect);
surface_rect
.round_out()
.translate(-surface_bounds.min.to_vector())
.round_out()
.intersection(&surface_bounds.size().round().into())