swf: Mark some `Matrix` functions as `const`

This commit is contained in:
relrelb 2022-05-29 20:54:45 +03:00 committed by relrelb
parent 6114f14fe0
commit 60a1dbfb07
1 changed files with 4 additions and 4 deletions

View File

@ -51,11 +51,11 @@ impl Matrix {
/// Returns a scale matrix. /// Returns a scale matrix.
#[inline] #[inline]
pub fn scale(scale_x: Fixed16, scale_y: Fixed16) -> Self { pub const fn scale(scale_x: Fixed16, scale_y: Fixed16) -> Self {
Self { Self {
a: scale_x, a: scale_x,
d: scale_y, d: scale_y,
..Default::default() ..Self::IDENTITY
} }
} }
@ -73,11 +73,11 @@ impl Matrix {
/// Returns a translation matrix. /// Returns a translation matrix.
#[inline] #[inline]
pub fn translate(x: Twips, y: Twips) -> Self { pub const fn translate(x: Twips, y: Twips) -> Self {
Self { Self {
tx: x, tx: x,
ty: y, ty: y,
..Default::default() ..Self::IDENTITY
} }
} }