diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2017-02-19 05:10:57 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-19 05:10:57 -0800 |
commit | d2ae3d8bedf99c97877ec944d94f2aa72e67478d (patch) | |
tree | 8e4acdff088514735dd9eb3511da013af21a7478 /components | |
parent | debdebe8dea69c41472002bb49dbb29cc30a85f2 (diff) | |
parent | f362f6f93bc79de6ba32995cdd96382dc5bc311f (diff) | |
download | servo-d2ae3d8bedf99c97877ec944d94f2aa72e67478d.tar.gz servo-d2ae3d8bedf99c97877ec944d94f2aa72e67478d.zip |
Auto merge of #15334 - canaltinova:inverse, r=nox
Fix the panic when transform is non-invertible
<!-- Please describe your changes on the following line: -->
Fixes the panic when transform is non-invertible.
Counterpart of https://github.com/servo/webrender/pull/823
r? @glennw
---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #13266 (github issue number if applicable).
<!-- Either: -->
- [x] There are tests for these changes OR
- [ ] These changes do not require tests because _____
<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/15334)
<!-- Reviewable:end -->
Diffstat (limited to 'components')
-rw-r--r-- | components/gfx/display_list/mod.rs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/components/gfx/display_list/mod.rs b/components/gfx/display_list/mod.rs index ec3173cb847..af4b793c6b2 100644 --- a/components/gfx/display_list/mod.rs +++ b/components/gfx/display_list/mod.rs @@ -182,7 +182,14 @@ impl DisplayList { *client_point } else { let point = *translated_point - stacking_context.bounds.origin; - let inv_transform = stacking_context.transform.inverse().unwrap(); + let inv_transform = match stacking_context.transform.inverse() { + Some(transform) => transform, + None => { + // If a transform function causes the current transformation matrix of an object + // to be non-invertible, the object and its content do not get displayed. + return; + } + }; let frac_point = inv_transform.transform_point(&Point2D::new(point.x.to_f32_px(), point.y.to_f32_px())); Point2D::new(Au::from_f32_px(frac_point.x), Au::from_f32_px(frac_point.y)) |