mod atmosphere;
mod blend;
mod canvas;
mod clip;
mod command;
mod context;
mod evaluation;
pub mod mesh;
pub mod paint;
mod stroke;
pub use crate::shape::{Shape, Styled};
pub use atmosphere::{AtmosphereKind, AtmospherePaint, AtmosphereParameters};
pub use blend::{BlendMode, BlendSpace, FillRule, MaskMode};
pub use canvas::Canvas;
pub use clip::{ClipGeometry, ClipMode, IntoShapeClip, PathClip, RectClip, ShapeClip};
pub use command::DrawCommand;
pub use context::{DeferredContent, DrawContext, Drawable, RenderQuality};
pub use evaluation::Evaluation;
pub use mesh::{
MAX_MESH_POINTS_PER_AXIS, MAX_MESH_SUBDIVISIONS, MeshGradient, MeshImage, MeshPaint, MeshPatch,
MeshVertex,
};
pub use paint::{
GradientExtend, GradientSpace, GradientUnits, ImagePattern, LinearGradient, Paint,
PatternImage, RadialGradient, SweepGradient, WeakPatternImage,
};
pub use stroke::{LineCap, LineJoin, MAX_STROKE_VERBS, StrokeStyle};
use std::sync::Arc;
use crate::validation::ValidationState;
use crate::{Path2D, Rect, Transform, ValidationError, ValidationLimits};
pub fn validate_rect(bounds: Rect, path: &str, field: &str) -> Result<(), ValidationError> {
if !bounds.is_finite()
|| bounds.right < bounds.left
|| bounds.bottom < bounds.top
|| !bounds.width().is_finite()
|| !bounds.height().is_finite()
{
return Err(ValidationError::invalid(
path,
field,
"Require finite, noninverted rectangle bounds and finite spans",
));
}
Ok(())
}
#[cfg(test)]
mod tests;