Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
aa59657
Converted code to typescript, test runner to testem
jedateach Jul 24, 2020
58a02c0
Fix travis config to perform build prior to running tests
jedateach Jul 24, 2020
f8c9b62
Improve watch server configuration
jedateach Jul 24, 2020
8cccc68
Introduce eslint for typescript, and fix issues
jedateach Jul 24, 2020
5784231
Attempt to fix headless tests
jedateach Jul 24, 2020
88c4626
Try that 🤷‍♂️
jedateach Jul 24, 2020
fbb5305
Added missing HEADLESS env var
jedateach Jul 24, 2020
514b0d4
Fix click event
jedateach Jul 27, 2020
5dd8897
Revert typing fix, and resolve using type information
jedateach Jul 27, 2020
78db9dd
Added some missing return types
jedateach Jul 27, 2020
5a55573
Refactored demo code into multiple files
jedateach Jul 27, 2020
046d624
Minor demo tidy
jedateach Jul 27, 2020
c4c18fe
Add missing type information
jedateach Jul 27, 2020
7b12819
Separated reorientResizeCursor out to helper file
jedateach Jul 27, 2020
a004aad
Unindent + simplify seelct method
jedateach Jul 28, 2020
6160173
Refactored select method into multiple methods
jedateach Jul 31, 2020
5b8d890
General decoupling refactor
jedateach Aug 1, 2020
d4a73ef
Removed console log, and reformat file
jedateach Aug 1, 2020
347ee39
Flattened tool event binding
jedateach Aug 1, 2020
7b9d3d2
Moved common handles dimming / stage updating into shared event handler
jedateach Aug 1, 2020
15e1dee
Generalised the positioning and resizing of handles
jedateach Aug 1, 2020
098c5f2
Separated out common stage update call when dragging
jedateach Aug 1, 2020
df5f53e
Rely on copied state in freetransform tool to do calculations
jedateach Aug 1, 2020
64606c2
TODO updates
jedateach Aug 1, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dist
.nyc-output
/*.js
29 changes: 14 additions & 15 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
{
"root": true,
"rules": {},
"env": {
"es6": true,
"browser": true,
"jasmine": true
},
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module"
},
"plugins": ["jasmine"],
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"],
"extends": [
"eslint:recommended",
"plugin:prettier/recommended",
"plugin:jasmine/recommended"
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended"
],
"globals": {
"createjs": true
"rules": {
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/no-namespace": "off",
"@typescript-eslint/camelcase": "off",
"no-sparse-arrays": "off",
"no-prototype-builtins": "off"
}
}
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
node_modules
package-lock.json
research
research
/dist
/tmp
/coverage
/docs
8 changes: 8 additions & 0 deletions .nycrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"cache": false,
"compact": false,
"reporter": ["text", "lcov"],
"excludeAfterRemap": false,
"all": true,
"temp-dir": "tmp"
}
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
language: node_js
# TODO: break out browsers into matrix

addons:
chrome: stable
node_js:
- 10
before_script:
- "npm run build"
deploy:
provider: npm
email: [email protected]
Expand Down
55 changes: 55 additions & 0 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,48 @@
# TODO

Convert to Typescript?

Update border, and constrain elements

## Transforming a transformed Container's child DisplayObjects

It is useful to support transforming elements within a container that might also have some transformations applied.

Use case: design area has been resized/zoomed.

Currently the coordinate systems are out, and the boundary mechanism fails too.

Come up with a design / plan...

We might need to introduce functions for transforming through parent layers.

## Decomposing tools into classes

Conceptually tool sequence is:

- Provides a handle that can be dragged
- Take the handle's start and current events, the registration point
- Produces a potential transformation (of various types)
- Transformation gets limited by new bounds
- DisplayObject gets updated with final transform

Tools therefore need to know:

- Orientation point
- How to limit a transformation? Surely this is deterministic, but in some cases the math is hard, such as scaling

Tools don't need to know

## Types of bounds

Oriented Bounds - bounds that have been positioned, rotated, scaled with the target
Simple Boundary Bounds - bounds that wrap the transformed oriented bounds
Complex Boundary Bounds - bounds that wrap the complexities of a shape: eg vector graphics, various primitive shapes, or images with some pixel analysis.

We'll settle for a simple bounds approach, since reorienting isn't common.

Current issue: we rely on un-oriented bounds to collide with boundary, resulting in the objects crossing over the boundary. Perhaps this is ok.

## Build test infrastructure

- Build out test suite
Expand Down Expand Up @@ -72,3 +113,17 @@ Features
- Allow moving the registration point with a handle

- Prevent or warn when scaling above best print resolution

Generalising cursor update logic

```js
const ANGLE_STEP = 45;
const DIRECTIONS = ["n", "ne", "e", "se", "s", "sw", "w", "nw"];

export function angleToOrdinalDirection(angle: number): string {
const index =
Math.floor((angle + 360) / ANGLE_STEP + 0.5) % DIRECTIONS.length;
console.log(angle, DIRECTIONS[index], index);
return DIRECTIONS[index];
}
```
Loading