Fix brush layers growing hugely when resizing transforms with Select tool (#1201)

* Fix brush tool resize

* Fix typo

* Fix image transforms

* Remove input from image network

* Fix merge error

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
0HyperCube 2023-05-07 12:17:12 +01:00 committed by Keavon Chambers
parent d7c5658852
commit ab2de96640
4 changed files with 35 additions and 25 deletions

View file

@ -243,6 +243,13 @@ where
impl<P: Copy + Pixel> ImageFrame<P> {
pub const fn empty() -> Self {
Self {
image: Image::empty(),
transform: DAffine2::ZERO,
}
}
pub const fn identity() -> Self {
Self {
image: Image::empty(),
transform: DAffine2::IDENTITY,
@ -307,7 +314,7 @@ pub struct ExtractImageFrame;
impl<'a: 'input, 'input> Node<'input, EditorApi<'a>> for ExtractImageFrame {
type Output = ImageFrame<Color>;
fn eval(&'input self, mut editor_api: EditorApi<'a>) -> Self::Output {
editor_api.image_frame.take().unwrap_or(ImageFrame::empty())
editor_api.image_frame.take().unwrap_or(ImageFrame::identity())
}
}