From bc997b7c3380d5f516f0aa58efc3dd513d75fafb Mon Sep 17 00:00:00 2001 From: Laurenz Date: Fri, 27 Nov 2020 20:01:54 +0100 Subject: =?UTF-8?q?Export=20images=20in=20PDF=20=F0=9F=96=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/README.md | 1 + tests/typeset.rs | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'tests') 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; -- cgit v1.2.3