mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-22 19:48:13 +08:00
Structure record stack rewinds as scope guards and make reserve unsafe
This commit is contained in:
@@ -19,21 +19,13 @@ use raster_types::BitmapMut;
|
||||
use raster_types::Image;
|
||||
use raster_types::{CPU, Raster};
|
||||
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
#[derive(Clone, Copy, Debug, PartialEq, dyn_any::DynAny)]
|
||||
pub struct BrushStampGenerator<P: Pixel + Alpha> {
|
||||
color: P,
|
||||
feather_exponent: f32,
|
||||
transform: DAffine2,
|
||||
}
|
||||
|
||||
// SAFETY: `Static` is `Self` with `P` at its own static projection.
|
||||
unsafe impl<P: Pixel + Alpha + dyn_any::StaticTypeSized> dyn_any::StaticType for BrushStampGenerator<P>
|
||||
where
|
||||
P::Static: Pixel + Alpha,
|
||||
{
|
||||
type Static = BrushStampGenerator<P::Static>;
|
||||
}
|
||||
|
||||
impl<P: Pixel + Alpha> Transform for BrushStampGenerator<P> {
|
||||
fn transform(&self) -> DAffine2 {
|
||||
self.transform
|
||||
|
||||
Reference in New Issue
Block a user