* Allow 'isTouching' and 'pick' to still work on invisible drawables.
* Always ignore visibility for isTouching on drawable
* Filter invisble drawbles in isTouchingDrawable per rules of collision
* polish up some docs/get logic 👍
* leftover line from deleted comment
* revert to ghosted pick behavior
* Add clientSpaceToScratchBounds method
* fix lint
* add some pick tests
Note there was an inconsequential coordinate flip in the original
transformation code, which was fixed in order for the sliced bounds to
work. The change is at line 388
fix the bug #131 Rotation center is incorrect while sprite is scaled by "changeSize" block or "setSize" block
the "rotationAdjusted" should be scaled while the drawable target is scaled.
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).
- `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.
- Add & correct a few comments
- Make `Drawable` IDs work like `Skin` IDs
- Remove some dead code
- Fix costume resolution in `BitmapSkin` before first `setBitmap` call
- Rename `Drawable` & `Skin` management variables in `RenderWebGL` to
clarify their purpose and better distinguish them from each other
- Remove problematic premature optimization in `_drawThese`
- Fix missing return statement in `Skin`'s `setRotationCenter`
- Fix mismatch between getTexture & getUniforms in the `Skin` class
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.
The `setStageSize` wasn't working correctly. This change fixes that and
also notifies active `PenDrawable` instances about the resize. This was
implemented by making the renderer an `EventEmitter`.
To test, load the playground and type `renderer.createPenDrawable()`
into the JS console. Note that the pen layer is now just another
drawable object, so it can move and use effects.
It turns out that it might make sense for the pen to share these
features. Splitting them out would likely work too, but would introduce
unnecessary complexity.
The skin-based implementation of `Drawable` has been moved into a new
class called `SkinnedDrawable`. This makes room for `PenLayer` to become
a new type of `Drawable`.
Some callbacks used a variable called `instance` to stash `this` for use
inside the callback. Now that those callbacks have been converted from
`function` to `=>`, they can just use `this` instead.
* Start of an SVG rendering quirks mode
* Provide font defaults in SVG quirks mode
* Remove svg-to-image dependency
* Remove fonts and use package fonts instead.
* try/finally for getBBox
* Add Rectangle utility and use it in Drawable.getBounds
* Add `getAABB`, `getFastBounds`.
* Add width and height getters to Rectangle
* Add rectangle clamp
* Optimized isTouchingColor
* Optimized isTouchingDrawables
* Rectangle.ceil -> Rectangle.snapToInt
* Refactor to common _touchingQueryCandidates
* Split helper into two