8 Commits

Author SHA1 Message Date
Christopher Willis-Ford
49f7b06dbe Lint fixes 2017-09-06 15:23:28 -06:00
Wang Yu
dc6ab7da08 Increased SKIN_SHARE_SOFT_LIMIT to 301, so
scratch-vm will not throw a EventEmitter memory leak warning.

Reason:
the max number of clones is 300, plus 1 for itself.
Then the shared skin will exceed it's limit.
Changing the number from 300 to 301 fixes this issue.
2017-04-18 20:06:02 +08:00
Christopher Willis-Ford
53147d7e39 Remove createSkinFromURL and related code
Changes:
- Removed the `createSkinFromURL` method.
- Removed `skin` property handling from `updateDrawableProperties`.
- Removed the URL-to-skin mapping cache.
- Removed `RenderConstants` items related to choosing a default skin.
- Removed `xhr` package dependency.
- `Drawable` now starts with a `null` skin instead of a default skin.
- `DrawThese` now skips any item with a `null` skin.
2017-03-09 09:59:16 -08:00
Ray Schamp
3c6511d94e Generate docs from src, publish to gh-pages
Fix any broken JSDoc syntax. Unfortunately there is no way to document tuples like `{[int, int]}` for a `[width, height]` array. We could possibly fix this and make the code more readable with `{width: number, height: number}` instead of tuples.

Remove single `@fileoverview` from Rectangle.js, since it was the only file with one and was weird to have that one module show up on the docs home page.

Add a `docs` script to `package.json`, run it from `npm test`, so invalid docs will cause tests to fail (eventually we may want to start using eslint-plugin-jsdoc to catch these errors with the linter alone).
2017-02-21 14:46:24 -05:00
Christopher Willis-Ford
140c0fbf37 Merge skin classes, convert PenDrawable to PenSkin
Merge the "skin classes" work from another branch and move/convert the
pen work from `PenDrawable` to `PenSkin`.
2017-01-05 16:25:53 -08:00
Christopher Willis-Ford
1f0cd4b61f Fix resource leaks discovered while testing
- `Drawable` now removes its `Skin` on `dispose`, disconnecting events.
- Creating a new `Drawable` doesn't always create a new `Skin` any more:
  now it can share an existing skin.
- Don't throw when asked to update the properties of a `Drawable` that
  has already been destroyed. This seems like a VM bug but was causing
  overwhelming output in the browser for some projects.
2016-12-29 13:42:58 -08:00
Christopher Willis-Ford
64c5991486 Split Skin functionality out of Drawable
There is now a `Skin` base class along with `SVGSkin` and `BitmapSkin`
classes for vector and bitmap skin support. Loading a skin by URL is in
the process of being deprecated. In the future skin data should be
downloaded outside the renderer and supplied through new `create*Skin`
API calls.
2016-12-28 12:17:45 -08:00
Christopher Willis-Ford
4730a057ff Move Drawable.NONE into new RenderConstants
This constant will soon be shared with another class.
2016-12-22 12:58:58 -08:00