Clean up transform tests
diff --git a/sparse_strips/vello_sparse_tests/snapshots/glyphs_decoration_size_values.png b/sparse_strips/vello_sparse_tests/snapshots/glyphs_decoration_size_values.png index 7d57a1f..af0cbe1 100644 --- a/sparse_strips/vello_sparse_tests/snapshots/glyphs_decoration_size_values.png +++ b/sparse_strips/vello_sparse_tests/snapshots/glyphs_decoration_size_values.png
@@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8fd70e2089e7562abdcdb4d0d88f0931bbd4f98d547941addb103136b378dc60 -size 2352 +oid sha256:17a9892e18a07c7a0ff865f1e9cd8fd79401cf1e1b7a22c51d317c3088993066 +size 2351
diff --git a/sparse_strips/vello_sparse_tests/snapshots/glyphs_decoration_transformed.png b/sparse_strips/vello_sparse_tests/snapshots/glyphs_decoration_transformed.png index 1ea3451..455c88b 100644 --- a/sparse_strips/vello_sparse_tests/snapshots/glyphs_decoration_transformed.png +++ b/sparse_strips/vello_sparse_tests/snapshots/glyphs_decoration_transformed.png
@@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f4a214f5451377e93fd63fe756c99c3ebcae9831a744f89489efb4b559b2c777 -size 1297 +oid sha256:0843b0a86a5d2ed04dcd96f0a75d903667867493d7afa38c2e2ce3be89e81785 +size 2454
diff --git a/sparse_strips/vello_sparse_tests/snapshots/glyphs_decoration_transformed_cached.png b/sparse_strips/vello_sparse_tests/snapshots/glyphs_decoration_transformed_cached.png index 14e9504..b3e4ccc 100644 --- a/sparse_strips/vello_sparse_tests/snapshots/glyphs_decoration_transformed_cached.png +++ b/sparse_strips/vello_sparse_tests/snapshots/glyphs_decoration_transformed_cached.png
@@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:2daa5f3388c0d72d328ddb5d5bb11b25020551a7bc6afb7f8f13a59c384385a9 -size 1326 +oid sha256:a4fa52cdf7e82edefd4ed64f80f94c27655962b69641de98a7c10b06970a064c +size 2450
diff --git a/sparse_strips/vello_sparse_tests/tests/glyph.rs b/sparse_strips/vello_sparse_tests/tests/glyph.rs index 55614a1..0369e10 100644 --- a/sparse_strips/vello_sparse_tests/tests/glyph.rs +++ b/sparse_strips/vello_sparse_tests/tests/glyph.rs
@@ -872,24 +872,27 @@ render_decorated_text(ctx, "HELLO", 50.0, enable_caching, None, -2.0, 2.0, 1.5); } -#[vello_test(width = 150, height = 100, glyph, hybrid_tolerance = 1)] +#[vello_test(width = 100, height = 150, glyph, hybrid_tolerance = 1)] fn glyphs_decoration_transformed(ctx: &mut impl Renderer, enable_caching: bool) { - let text = "Hpjy"; - let rows: [(Affine, f32, Option<Affine>); 3] = [ - // Run-level scale absorbs into font_size - (Affine::scale(20.0), 1.0, None), + let text = "Happy"; + let rows: [(Affine, f32, Option<Affine>, f64); 4] = [ + // Run-level scale absorbs into font_size and underline scaled. + (Affine::scale(2.0), 12.0, None, 30.0), // Glyph-level scale (affects skip-ink outline transform) - (Affine::IDENTITY, 10.0, Some(Affine::scale(2.0))), + (Affine::IDENTITY, 10.0, Some(Affine::scale(1.2)), 40.0), // Y-flip (decoration should appear above the flipped text) ( Affine::scale_non_uniform(1.0, -1.0) * Affine::translate((0.0, 20.0)), 20.0, None, + 10.0, ), + // Rotated text + (Affine::rotate(f64::from(FRAC_PI_4)), 12.0, None, 40.0), ]; - let mut y = 28.35; - for (run_transform, font_size, glyph_transform) in rows { + let mut y = 30.0; + for (run_transform, font_size, glyph_transform, buffer) in rows { ctx.set_transform(Affine::translate((16.0, y)) * run_transform); render_decorated_text( ctx, @@ -901,6 +904,6 @@ 1.0, 1.0, ); - y += 30.0; + y += buffer; } }