diff --git a/src/main.rs b/src/main.rs index 00cdf37..6194f28 100644 --- a/src/main.rs +++ b/src/main.rs @@ -254,8 +254,21 @@ fn canvas_map(props: &CanvasMapProps) -> Html { ); let draw_marker = move |ctx: &CanvasRenderingContext2d, icon: &HtmlImageElement| { - off_ctx.set_global_composite_operation("multiply").unwrap(); off_ctx.clear_rect(0.0, 0.0, high_res_size, high_res_size); + off_ctx + .draw_image_with_html_image_element_and_sw_and_sh_and_dx_and_dy_and_dw_and_dh( + icon, + 0.0, + 0.0, + icon.width() as f64, + icon.height() as f64, + 0.0, + 0.0, + high_res_size, + high_res_size, + ) + .unwrap(); + off_ctx.set_global_composite_operation("multiply").unwrap(); off_ctx.set_fill_style_str(&rgba); off_ctx.fill_rect(0.0, 0.0, high_res_size, high_res_size);