|
15 | 15 | use scenes::ImageCache; |
16 | 16 | use vello::{ |
17 | 17 | AaConfig, Scene, |
18 | | - kurbo::{Affine, Rect}, |
| 18 | + kurbo::{Affine, Point, Rect, Size}, |
19 | 19 | peniko::{Extend, ImageFormat, ImageQuality, color::palette}, |
20 | 20 | }; |
21 | 21 | use vello_tests::{TestParams, smoke_snapshot_test_sync}; |
@@ -78,6 +78,26 @@ fn many_bins_cpu() { |
78 | 78 | many_bins(true); |
79 | 79 | } |
80 | 80 |
|
| 81 | +/// Test for <https://github.com/linebender/vello/issues/1066> |
| 82 | +#[test] |
| 83 | +#[should_panic] |
| 84 | +fn test_negative_dash_offset() { |
| 85 | + let mut scene = Scene::new(); |
| 86 | + let stroke = vello::kurbo::Stroke::new(1.0).with_dashes(-30., [4., 2.]); |
| 87 | + scene.stroke( |
| 88 | + &stroke, |
| 89 | + Affine::IDENTITY, |
| 90 | + vello::peniko::Color::from_rgb8(0, 255, 0), |
| 91 | + None, |
| 92 | + &Rect::from_origin_size(Point::new(1., 1.), Size::new(28., 28.)), |
| 93 | + ); |
| 94 | + let mut params = TestParams::new("negative_dash_offset", 30, 30); |
| 95 | + params.anti_aliasing = AaConfig::Area; |
| 96 | + smoke_snapshot_test_sync(scene, ¶ms) |
| 97 | + .unwrap() |
| 98 | + .assert_mean_less_than(0.001); |
| 99 | +} |
| 100 | + |
81 | 101 | const DATA_IMAGE_PNG: &[u8] = include_bytes!("../snapshots/smoke/data_image_roundtrip.png"); |
82 | 102 |
|
83 | 103 | /// Test for <https://github.com/linebender/vello/issues/972> |
|
0 commit comments