summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2020-11-27 20:01:54 +0100
committerLaurenz <laurmaedje@gmail.com>2020-11-27 20:01:54 +0100
commitbc997b7c3380d5f516f0aa58efc3dd513d75fafb (patch)
tree7c16e93800f6e27bb90d87a1d2caefdfedc4e1de /tests
parentb4f809f1ea8a469d0bdee225f47d7f09bc22aa61 (diff)
Export images in PDF 🖼
Diffstat (limited to 'tests')
-rw-r--r--tests/README.md1
-rw-r--r--tests/typeset.rs4
2 files changed, 3 insertions, 2 deletions
diff --git a/tests/README.md b/tests/README.md
index 3ae908af..6ebba237 100644
--- a/tests/README.md
+++ b/tests/README.md
@@ -5,3 +5,4 @@
- `png`: PNG files produced by tests
- `ref`: Reference images which the PNGs are compared to byte-wise to determine
whether the test passed or failed
+- `res`: Resource files used by tests
diff --git a/tests/typeset.rs b/tests/typeset.rs
index 38651766..d9a1056a 100644
--- a/tests/typeset.rs
+++ b/tests/typeset.rs
@@ -247,8 +247,8 @@ fn draw_text(canvas: &mut Canvas, loader: &FontLoader, shaped: &Shaped, pos: Poi
fn draw_image(canvas: &mut Canvas, image: &ImageElement, pos: Point) {
let mut pixmap = Pixmap::new(image.buf.width(), image.buf.height()).unwrap();
for (src, dest) in image.buf.pixels().zip(pixmap.pixels_mut()) {
- let [r, g, b, a] = src.0;
- *dest = ColorU8::from_rgba(r, g, b, a).premultiply();
+ let [r, g, b] = src.0;
+ *dest = ColorU8::from_rgba(r, g, b, 255).premultiply();
}
let view_width = image.size.width.to_pt() as f32;