Remove the UVec2 and IVec2 graph data types and have Artboard use DVec2 (#2894)

This commit is contained in:
Keavon Chambers
2025-07-16 18:45:10 -07:00
committed by GitHub
parent 99966d848d
commit 8f26c5c2ad
17 changed files with 49 additions and 87 deletions

View File

@@ -466,11 +466,14 @@ async fn to_artboard<Data: Into<GraphicGroupTable> + 'n>(
)]
contents: impl Node<Context<'static>, Output = Data>,
label: String,
location: IVec2,
dimensions: IVec2,
location: DVec2,
dimensions: DVec2,
background: Color,
clip: bool,
) -> Artboard {
let location = location.as_ivec2();
let dimensions = dimensions.as_ivec2().max(IVec2::ONE);
let footprint = ctx.try_footprint().copied();
let mut new_ctx = OwnedContextImpl::from(ctx);
if let Some(mut footprint) = footprint {

View File

@@ -26,8 +26,6 @@ pub mod types {
pub type IntegerCount = u32;
/// Unsigned integer to be used for random seeds
pub type SeedValue = u32;
/// Non-negative integer coordinate with px unit
pub type Resolution = glam::UVec2;
/// DVec2 with px unit
pub type PixelSize = glam::DVec2;
/// String with one or more than one line

View File

@@ -165,8 +165,7 @@ tagged_value! {
U64(u64),
Bool(bool),
String(String),
UVec2(UVec2),
IVec2(IVec2),
#[serde(alias = "IVec2", alias = "UVec2")]
DVec2(DVec2),
DAffine2(DAffine2),
OptionalF64(Option<f64>),