Skip to content

Commit f046014

Browse files
authored
Fix panic for tiny anti-aliased rectangles (#119)
1 parent aed7139 commit f046014

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/scan/hairline_aa.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,6 @@ fn fill_dot8(l: FDot8, t: FDot8, r: FDot8, b: FDot8, fill_inner: bool, blitter:
120120
} else {
121121
debug_assert!(false);
122122
}
123-
} else {
124-
debug_assert!(false);
125123
}
126124
}
127125

tests/integration/fill.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,16 @@ fn tiny_float_rect_aa() {
187187
);
188188
}
189189

190+
#[test]
191+
fn tiny_rect_aa() {
192+
let mut paint = Paint::default();
193+
paint.set_color_rgba8(0, 0, 0, 0);
194+
paint.anti_alias = true;
195+
let rect = Rect::from_xywh(0.7, 0.0, 1.0, 2.0).unwrap();
196+
let mut pixmap = Pixmap::new(10, 10).unwrap();
197+
pixmap.fill_rect(rect, &paint, Transform::identity(), None);
198+
}
199+
190200
#[test]
191201
fn float_rect_clip_top_left_aa() {
192202
let mut paint = Paint::default();

0 commit comments

Comments
 (0)