mirror of
https://github.com/servo/servo.git
synced 2025-08-11 00:15:32 +01:00
Auto merge of #16451 - mantaroh:animate_perspective_origin, r=hiro,emilio
Make perspective origin animatable This is a PR for https://bugzilla.mozilla.org/show_bug.cgi?id=1355344 --- <!-- 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 <!-- Either: --> - [X] There are tests for these changes, a test case will be landed in web-platform-tests in https://bugzilla.mozilla.org/show_bug.cgi?id=1355344 <!-- 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/16451) <!-- Reviewable:end -->
This commit is contained in:
commit
533853fdce
2 changed files with 15 additions and 16 deletions
|
@ -2123,6 +2123,17 @@ fn static_assert() {
|
|||
self.gecko.mPerspectiveOrigin[1].copy_from(&other.gecko.mPerspectiveOrigin[1]);
|
||||
}
|
||||
|
||||
pub fn clone_perspective_origin(&self) -> longhands::perspective_origin::computed_value::T {
|
||||
use properties::longhands::perspective_origin::computed_value::T;
|
||||
use values::computed::LengthOrPercentage;
|
||||
T {
|
||||
horizontal: LengthOrPercentage::from_gecko_style_coord(&self.gecko.mPerspectiveOrigin[0])
|
||||
.expect("Expected length or percentage for horizontal value of perspective-origin"),
|
||||
vertical: LengthOrPercentage::from_gecko_style_coord(&self.gecko.mPerspectiveOrigin[1])
|
||||
.expect("Expected length or percentage for vertical value of perspective-origin"),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn set_transform_origin(&mut self, v: longhands::transform_origin::computed_value::T) {
|
||||
self.gecko.mTransformOrigin[0].set(v.horizontal);
|
||||
self.gecko.mTransformOrigin[1].set(v.vertical);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue