mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2025-08-04 21:37:59 +00:00
Fix crashes related to 0-scale shapes (#777)
* Fix crashes when dragging the bounding box/transform cage of a 0-scale shape. * Fix crashes when dragging the pivot point of a 0-scale shape * Fix rotation computation on DAffine2 when scale.x is 0, avoids Nan display * remove remaining log::info that I introduced in earlier commit * Fix crash when updating the scale of a transform that was already 0. * Fix NumberInput behaviour when the requested value changed is does not happen. * Fix rotation computation when Scale X and Scale Y are both 0. Display 0. This also fixes crashes when modifying the rotation in such case
This commit is contained in:
parent
788552e10c
commit
54b63c3eb5
4 changed files with 41 additions and 11 deletions
|
@ -183,9 +183,10 @@ export default defineComponent({
|
|||
if (typeof this.min === "number" && !Number.isNaN(this.min) && cleaned !== undefined) cleaned = Math.max(cleaned, this.min);
|
||||
if (typeof this.max === "number" && !Number.isNaN(this.max) && cleaned !== undefined) cleaned = Math.min(cleaned, this.max);
|
||||
|
||||
if (newValue !== undefined) this.$emit("update:value", cleaned);
|
||||
// Required as the call to update:value can, not change the value
|
||||
this.text = this.displayText(this.value);
|
||||
|
||||
this.text = this.displayText(cleaned);
|
||||
if (newValue !== undefined) this.$emit("update:value", cleaned);
|
||||
},
|
||||
displayText(value: number | undefined): string {
|
||||
if (value === undefined) return "-";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue