Graphite/frontend/src/components
Boutillier 54b63c3eb5 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
2022-09-12 10:46:11 +02:00
..
floating-menus Remove usage of 'null' in favor of 'undefined' 2022-08-25 21:32:27 -07:00
layout Remove usage of 'null' in favor of 'undefined' 2022-08-25 21:32:27 -07:00
panels Remove usage of 'null' in favor of 'undefined' 2022-08-25 21:32:27 -07:00
widgets Fix crashes related to 0-scale shapes (#777) 2022-09-12 10:46:11 +02:00
window Prefix all type imports with the 'type' keyword where appropriate 2022-08-25 15:38:21 -07:00
README.md Reorganize Vue components and add documentation explaining each folder 2022-05-23 19:03:34 -07:00

README.md

Overview of /frontend/src/components/

Each component represents a (usually reusable) part of the Graphite Editor GUI. These all get mounted within the Vue entry point, App.vue, in the /src directory above this one.

Floating Menus: floating-menus/

The temporary UI areas with dark backgrounds which hover over the top of the editor window content. Examples include popovers, dropdown menu selectors, and dialog modals.

Layout: layout/

Useful containers that control the flow of content held within.

Panels: panels/

The dockable tabbed regions like the Document, Properties, Layer Tree, and Node Graph panels.

Widgets: widgets/

The interactive input items used to display information and provide user control.

Window: window/

The building blocks for the Title Bar, Workspace, and Status Bar within an editor application window.

Vue tips and tricks

This section contains a growing list of quick reference information for helpful Vue solutions and best practices. Feel free to add to this to help contributors learn things, or yourself remember tricks you'll likely forget in a few months.

Bi-directional props

The component declares this:

export default defineComponent({
	emits: ["update:theBidirectionalProperty"],
	props: {
		theBidirectionalProperty: { type: Number as PropType<number>, required: false },
	},
	watch: {
		// Called only when `theBidirectionalProperty` is changed from outside this component (with v-model)
		theBidirectionalProperty(newSelectedIndex: number | undefined) {

		},
	},
	methods: {
		doSomething() {
			this.$emit("update:theBidirectionalProperty", SOME_NEW_VALUE);
		},
	},
});

Users of the component do this for theCorrespondingDataEntry to be a two-way binding:

<DropdownInput v-model:theBidirectionalProperty="theCorrespondingDataEntry" />