Create iced_widget subcrate and re-organize the whole codebase

This commit is contained in:
Héctor Ramón Jiménez 2023-03-04 05:37:11 +01:00
parent c54409d171
commit 3a0d34c024
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
209 changed files with 1959 additions and 2183 deletions

View file

@ -1,10 +1,11 @@
use crate::core;
use crate::core::{Color, Font, Point, Size};
use crate::graphics::backend;
use crate::graphics::{Primitive, Transformation, Viewport};
use crate::quad;
use crate::text;
use crate::triangle;
use crate::{Layer, Primitive, Settings, Transformation};
use iced_graphics::backend;
use iced_graphics::{Color, Font, Size, Viewport};
use crate::{Layer, Settings};
#[cfg(feature = "tracing")]
use tracing::info_span;
@ -363,9 +364,9 @@ impl backend::Text for Backend {
size: f32,
font: Font,
bounds: Size,
point: iced_native::Point,
point: Point,
nearest_only: bool,
) -> Option<text::Hit> {
) -> Option<core::text::Hit> {
self.text_pipeline.hit_test(
contents,
size,
@ -383,17 +384,14 @@ impl backend::Text for Backend {
#[cfg(feature = "image")]
impl backend::Image for Backend {
fn dimensions(&self, handle: &iced_native::image::Handle) -> Size<u32> {
fn dimensions(&self, handle: &core::image::Handle) -> Size<u32> {
self.image_pipeline.dimensions(handle)
}
}
#[cfg(feature = "svg")]
impl backend::Svg for Backend {
fn viewport_dimensions(
&self,
handle: &iced_native::svg::Handle,
) -> Size<u32> {
fn viewport_dimensions(&self, handle: &core::svg::Handle) -> Size<u32> {
self.image_pipeline.viewport_dimensions(handle)
}
}