mirror of
https://github.com/bevyengine/bevy
synced 2024-11-22 04:33:37 +00:00
Remove thiserror
from bevy_sprite
(#15763)
# Objective - Contributes to #15460 ## Solution - Removed `thiserror` from `bevy_sprite`
This commit is contained in:
parent
b50f2ec334
commit
ecd04c1b72
3 changed files with 11 additions and 12 deletions
|
@ -37,7 +37,11 @@ bevy_derive = { path = "../bevy_derive", version = "0.15.0-dev" }
|
|||
bytemuck = { version = "1", features = ["derive", "must_cast"] }
|
||||
fixedbitset = "0.5"
|
||||
guillotiere = "0.6.0"
|
||||
thiserror = "1.0"
|
||||
derive_more = { version = "1", default-features = false, features = [
|
||||
"error",
|
||||
"from",
|
||||
"display",
|
||||
] }
|
||||
rectangle-pack = "0.4"
|
||||
bitflags = "2.3"
|
||||
radsort = "0.1"
|
||||
|
|
|
@ -36,6 +36,7 @@ use bevy_render::{
|
|||
use bevy_transform::components::{GlobalTransform, Transform};
|
||||
use bevy_utils::tracing::error;
|
||||
use core::{hash::Hash, marker::PhantomData};
|
||||
use derive_more::derive::From;
|
||||
|
||||
use crate::{
|
||||
DrawMesh2d, Mesh2d, Mesh2dPipeline, Mesh2dPipelineKey, RenderMesh2dInstances,
|
||||
|
@ -209,7 +210,7 @@ pub trait Material2d: AsBindGroup + Asset + Clone + Sized {
|
|||
/// commands.spawn(Mesh2d(meshes.add(Circle::new(50.0))));
|
||||
/// }
|
||||
/// ```
|
||||
#[derive(Component, Clone, Debug, Deref, DerefMut, Reflect, PartialEq, Eq)]
|
||||
#[derive(Component, Clone, Debug, Deref, DerefMut, Reflect, PartialEq, Eq, From)]
|
||||
#[reflect(Component, Default)]
|
||||
#[require(HasMaterial2d)]
|
||||
pub struct MeshMaterial2d<M: Material2d>(pub Handle<M>);
|
||||
|
@ -220,12 +221,6 @@ impl<M: Material2d> Default for MeshMaterial2d<M> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<M: Material2d> From<Handle<M>> for MeshMaterial2d<M> {
|
||||
fn from(handle: Handle<M>) -> Self {
|
||||
Self(handle)
|
||||
}
|
||||
}
|
||||
|
||||
impl<M: Material2d> From<MeshMaterial2d<M>> for AssetId<M> {
|
||||
fn from(material: MeshMaterial2d<M>) -> Self {
|
||||
material.id()
|
||||
|
|
|
@ -9,19 +9,19 @@ use bevy_utils::{
|
|||
tracing::{debug, error, warn},
|
||||
HashMap,
|
||||
};
|
||||
use derive_more::derive::{Display, Error};
|
||||
use rectangle_pack::{
|
||||
contains_smallest_box, pack_rects, volume_heuristic, GroupedRectsToPlace, PackedLocation,
|
||||
RectToInsert, TargetBin,
|
||||
};
|
||||
use thiserror::Error;
|
||||
|
||||
use crate::{TextureAtlasLayout, TextureAtlasSources};
|
||||
|
||||
#[derive(Debug, Error)]
|
||||
#[derive(Debug, Error, Display)]
|
||||
pub enum TextureAtlasBuilderError {
|
||||
#[error("could not pack textures into an atlas within the given bounds")]
|
||||
#[display("could not pack textures into an atlas within the given bounds")]
|
||||
NotEnoughSpace,
|
||||
#[error("added a texture with the wrong format in an atlas")]
|
||||
#[display("added a texture with the wrong format in an atlas")]
|
||||
WrongFormat,
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue