Skip to content

Fix crash when scaling something with 0 width or height#1078

Merged
Keavon merged 4 commits into
masterfrom
zero-scale-error
Mar 26, 2023
Merged

Fix crash when scaling something with 0 width or height#1078
Keavon merged 4 commits into
masterfrom
zero-scale-error

Conversation

@Sahra-Zhou

Copy link
Copy Markdown
Contributor

Avoided the crash and resolved NaN present in property panel when trying to change zero scale to some other value.

Closes #1043

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Mar 15, 2023

Copy link
Copy Markdown

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 0819537
Status: ✅  Deploy successful!
Preview URL: https://53490405.graphite.pages.dev
Branch Preview URL: https://zero-scale-error.graphite.pages.dev

View logs

@Sahra-Zhou Sahra-Zhou requested a review from 0HyperCube March 17, 2023 07:37
@Sahra-Zhou Sahra-Zhou marked this pull request as ready for review March 20, 2023 17:37
@Keavon Keavon changed the title Resolve Zero scale crash Fix crash when scaling something with 0 width or height Mar 21, 2023

@0HyperCube 0HyperCube left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work on this!

@Keavon

Keavon commented Mar 26, 2023

Copy link
Copy Markdown
Member

One UX nitpick is that the properties panel keeps (displays) the nonzero value typed by the user, even though value remains zero. This gets reset back to 0 properly after the user refreshes the UI by switching to another selected layer and back. But we can fix that at another time.

@Keavon Keavon merged commit 7117334 into master Mar 26, 2023
@Keavon Keavon deleted the zero-scale-error branch March 26, 2023 22:20
Keavon added a commit that referenced this pull request Jul 30, 2023
* resolve NaN value when trying to change scale value from zero to other numbers

* resolve NaN value when trying to change scale value from zero to other numbers

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
@Keavon

Keavon commented Jun 13, 2026

Copy link
Copy Markdown
Member

Hi @Sahra-Zhou, thanks again for this code contribution to the project! We're still hoping you will respond to the request to relicense this code. Please see #4208 ASAP, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Crash with zero scale

3 participants