Add constraints calculation on WASM (#5894)

*  Add constraints calculation on WASM

*  Fix after review
This commit is contained in:
Alonso Torres 2025-02-19 10:40:04 +01:00 committed by GitHub
parent f5c913d26e
commit 6cb1aa24cd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 746 additions and 76 deletions

View file

@ -1,8 +1,5 @@
use crate::{
math,
shapes::{Fill, ImageFill, Kind, Shape},
};
use skia_safe::{self as skia, RRect};
use crate::shapes::{Fill, ImageFill, Kind, Shape};
use skia_safe::{self as skia, RRect, Rect};
use super::RenderState;
@ -46,7 +43,7 @@ fn draw_image_fill_in_container(
let scaled_width = width * scale;
let scaled_height = height * scale;
let dest_rect = math::Rect::from_xywh(
let dest_rect = Rect::from_xywh(
container.left - (scaled_width - container_width) / 2.0,
container.top - (scaled_height - container_height) / 2.0,
scaled_width,