Size2D<f64> -> Size2D<u32> in canvas_traits::canvas::Canvas2dMsg

Changed the variants `canvas_traits::canvas::Canvas2dMsg::DrawEmptyImage` and
`canvas_traits::canvas::Canvas2dMsg::DrawImageInOther` to use
`euclid::default::Size2D<u32>` instead of `euclid::default::Size2D<f64>`. Every
other change made in this commit is either:
 - of similar nature, and is the minimum that would allow compilation
 - resolving lints triggered by the former

This commit includes changes to the following components:
 - canvas
 - script
 - shared/canvas

Signed-off-by: hashcatHitman <155700084+hashcatHitman@users.noreply.github.com>
This commit is contained in:
hashcatHitman 2025-06-01 16:08:17 -04:00
parent 326a2e9ab6
commit 892edc0048
No known key found for this signature in database
3 changed files with 18 additions and 18 deletions

View file

@ -187,7 +187,7 @@ impl<'a> CanvasPaintThread<'a> {
Canvas2dMsg::DrawEmptyImage(image_size, dest_rect, source_rect) => {
self.canvas(canvas_id).draw_image(
&vec![0; image_size.area() as usize * 4],
image_size.to_u32(),
image_size,
dest_rect,
source_rect,
false,
@ -203,7 +203,7 @@ impl<'a> CanvasPaintThread<'a> {
) => {
let image_data = self
.canvas(canvas_id)
.read_pixels(Some(source_rect.to_u32()), Some(image_size.to_u32()));
.read_pixels(Some(source_rect.to_u32()), Some(image_size));
self.canvas(other_canvas_id).draw_image(
image_data.data(),
source_rect.size.to_u32(),