summaryrefslogtreecommitdiff
path: root/src/export/render.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2022-11-04 09:30:44 +0100
committerLaurenz <laurmaedje@gmail.com>2022-11-04 11:38:09 +0100
commiteb951c008beea502042db4a3a0e8d1f8b51f6f52 (patch)
tree9856ee4ed0222222669de10e616a580b2a60135e /src/export/render.rs
parent33928a00dc58250e24da1dae4e5db17e7b598d70 (diff)
Style changes
Diffstat (limited to 'src/export/render.rs')
-rw-r--r--src/export/render.rs16
1 files changed, 5 insertions, 11 deletions
diff --git a/src/export/render.rs b/src/export/render.rs
index 41fff863..bc82e9c8 100644
--- a/src/export/render.rs
+++ b/src/export/render.rs
@@ -256,8 +256,8 @@ fn render_outline_glyph(
// Blend the glyph bitmap with the existing pixels on the canvas.
// FIXME: This doesn't respect the clipping mask.
let pixels = bytemuck::cast_slice_mut::<u8, u32>(canvas.data_mut());
- for x in left.clamp(0, cw) .. right.clamp(0, cw) {
- for y in top.clamp(0, ch) .. bottom.clamp(0, ch) {
+ for x in left.clamp(0, cw)..right.clamp(0, cw) {
+ for y in top.clamp(0, ch)..bottom.clamp(0, ch) {
let ai = ((y - top) * mw + (x - left)) as usize;
let cov = bitmap.coverage[ai];
if cov == 0 {
@@ -312,10 +312,7 @@ fn render_shape(
if let Some(Stroke { paint, thickness }) = shape.stroke {
let paint = paint.into();
- let stroke = sk::Stroke {
- width: thickness.to_f32(),
- ..Default::default()
- };
+ let stroke = sk::Stroke { width: thickness.to_f32(), ..Default::default() };
canvas.stroke_path(&path, &paint, &stroke, ts, mask);
}
@@ -342,11 +339,8 @@ fn render_image(
match image.decode().unwrap() {
DecodedImage::Raster(dynamic, _) => {
let downscale = w < image.width();
- let filter = if downscale {
- FilterType::Lanczos3
- } else {
- FilterType::CatmullRom
- };
+ let filter =
+ if downscale { FilterType::Lanczos3 } else { FilterType::CatmullRom };
let buf = dynamic.resize(w, h, filter);
for ((_, _, src), dest) in buf.pixels().zip(pixmap.pixels_mut()) {
let Rgba([r, g, b, a]) = src;