386 Commits

Author SHA1 Message Date
john
ada1902fa6 fix the rotation center bug
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.
2017-04-22 11:46:02 +08:00
Chris Willis-Ford
3ab8f4a70b Merge pull request #135 from bigeyex/feature/fix-skin-share-soft-limit
Increase SKIN_SHARE_SOFT_LIMIT to 301 to avoid sprite clone limit warning
2017-04-19 12:06:22 -07: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
a49594a
56fbe57dd9 Update RenderWebGL.js
fix exception "Invalid offset/length when creating typed array" in ms edge browser
2017-04-11 08:12:55 +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
Christopher Willis-Ford
10db85594f Generate /playground from /src/playground
The playground now must be loaded with a URL that ends in "/playground/"
or "/playground/index.html"; loading at "/" will no longer work.

The /playground folder is now purely an output of the build process,
rather than being a mix of build output and static content. The static
content that was previously there (namely, index.html) has been moved
into /src/playground. The `contentBase` has been set to `false` to avoid
confusion between current, in-memory build output and stale, on-disk
build output.
2017-03-08 14:48:57 -08:00
Christopher Willis-Ford
7db54d9066 Explicitly specify raw-loader for shader files
This helps standardize our Webpack config
2017-03-08 14:23:28 -08:00
Paul Kaplan
76886ad92b Add JSDoc for isStamping opt flag 2017-03-07 12:21:30 -05:00
Paul Kaplan
983c704761 Add stamping flag to make draw ignore visibility 2017-03-07 11:19:39 -05:00
Ray Schamp
2de55f0474 Add scratchOffset data to extractDrawable
Makes it easier to translate between canvas coordinates and scratch coordinates
2017-03-03 09:18:20 -05:00
Andrew Sliwinski
e67d8a2126 Merge pull request #94 from CSnap/getBounds
Fix getBounds for Hidden Sprites
2017-03-02 11:31:45 -05:00
Andrew Sliwinski
fc7610716e Merge pull request #96 from CSnap/fix_getConvexHullPointsForDrawable
Round pixelBase
2017-03-02 08:47:00 -05:00
Ray Schamp
b6008078ed Merge pull request #93 from griffpatch/feature/FenceAgain
Feature fenceagain
2017-02-23 09:25:53 -05:00
griffpatch
04f7e2ac24 Add const for FENCE_WIDTH
Pull out the 15 pixels into a const
2017-02-23 14:09:00 +00:00
Ray Schamp
9824d109b0 Merge pull request #102 from rschamp/jsdoc
Generate docs from src, publish to gh-pages
2017-02-23 08:42:10 -05:00
Chris Willis-Ford
71135236f2 Merge pull request #107 from LLK/greenkeeper/twgl.js-3.0.2
chore(package): update twgl.js to version 3.0.2
2017-02-22 21:15:52 -08:00
Christopher Willis-Ford
58801fab14 Fix drawBufferInfo call for twgl API change 2017-02-22 21:07:47 -08:00
Chris Willis-Ford
ed0c39c2ac Merge pull request #100 from TheBrokenRail/patch-1
Fix IE/Edge Support (#85 and LLK/scratch-vm#367)
2017-02-22 11:45:26 -08:00
TheBrokenRail
1113149363 Fix 2017-02-21 15:43:39 -05: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
Ray Schamp
b7d5610b23 Merge pull request #97 from rschamp/dnd
Add method to retrieve drawable pixel data
2017-02-21 14:45:17 -05:00
TheBrokenRail
ec2361cf91 Fix IE/Edge Support (#85) 2017-02-18 14:06:45 -05:00
Ray Schamp
68600e794d Return null for invalid drawableIDs 2017-02-18 12:18:04 -05:00
Ray Schamp
6dd3c0ed81 Don't clip drawables to stage when extracting 2017-02-17 17:37:05 -05:00
Ray Schamp
e035cadb04 Don't apply ghost when extracting drawables 2017-02-17 17:36:47 -05:00
Ray Schamp
3bc00176ed Refactor _drawThese to take options
So the number of arguments doesn't get out of hand
2017-02-17 17:35:45 -05:00
Ray Schamp
a65ea3daed Add method to retrieve drawable pixel data
Towards LLK/scratch-gui#66
2017-02-17 14:51:04 -05:00
SillyInventor
4eacde74e6 Round pixelBase to allow for non-integer SVG widths in _getConvexHullPointsForDrawable 2017-02-15 14:14:03 -05:00
griffpatch
f3b3f0aca7 Feature - Fencing again
This is a resubmission of the same scripts that got reverted. The actual
issues was within scratch-vm.
2017-02-15 16:19:08 +00:00
Ray Schamp
42e5e724c2 Revert "Feature fencing" 2017-02-15 09:38:23 -05:00
SillyInventor
9c51cf0a04 Switch to getFastBounds from get bounds, and add check for if the hull points are empty. 2017-02-14 19:58:22 -05:00
Christopher Willis-Ford
959c635f58 SVG: compensate for viewbox offset
In Scratch 2.0, an SVG costume's origin is stored relative to that SVG's
viewbox. In order to use the origin values correctly, then, we need to
compensate for the viewbox offset.
2017-02-14 15:59:45 -08:00
griffpatch
b39bb4d3fd Fencing Take 3
Refactor to accept and return a position as an array of ints [x, y]
2017-02-14 09:08:32 +00:00
griffpatch
1a3e9845d0 Merge remote-tracking branch 'refs/remotes/LLK/develop' into feature/fencing 2017-02-14 08:30:42 +00:00
griffpatch
100625c6d7 Fencing 2017-02-14 08:30:07 +00:00
griffpatch
fea7643e7e rename fencing method 2017-02-11 14:23:05 +00:00
Chris Willis-Ford
4d8b5da491 Merge pull request #84 from CSnap/fix_SkinMeasurements
Initialize Measurement
2017-02-10 12:04:54 -08:00
Chris Willis-Ford
fd4ef087d5 Merge pull request #79 from LLK/greenkeeper/initial
Update dependencies to enable Greenkeeper 🌴
2017-02-10 11:42:13 -08:00
SillyInventor
dc53feaf41 Initialize Measurement 2017-02-10 14:21:45 -05:00
Chris Willis-Ford
a0b3a687cd Merge pull request #81 from griffpatch/bug/alphaChannelConversion
Bug alphachannelconversion
2017-02-09 07:49:56 -08:00
griffpatch
4e21184854 Lint Issues
Comments too long
2017-02-09 10:04:48 +00:00
griffpatch
aa993779bb Feature - Fencing of drawables
Provide a method in the scratch-render to return the fenced coordinates
of a drawable moving to a given position.
2017-02-09 09:56:27 +00:00
griffpatch
4dba5db28d Alpha channel conversion
I wasn't so clever with this - I'm sorry. Now that I have managed to
link up my local render & vm projects I am able to fix the issue
properly. Many appologies!
2017-02-09 08:36:57 +00:00
Ray Schamp
9a8f4f2a88 Fix SVG size calculation
It was being incorrectly calculated based on devicePixelRatio.

Fixes LLK/scratch-gui#73. Thanks to @cwillisf for figuring it out!
2017-02-07 10:48:47 -05:00
Christopher Willis-Ford
805ec54f57 chore: adapt code for Webpack 2 2017-02-03 11:01:29 -08:00
griffpatch
6f5acfee7b Bug in alpha channel conversion
This is groundwork required by the issue:
https://github.com/LLK/scratch-vm/issues/393
2017-01-27 12:26:11 +00:00
Chris Willis-Ford
9841de85f1 Merge pull request #74 from CSnap/clear_fix
Clear Button Fix
2017-01-25 09:51:57 -05:00
Ray Schamp
2fc9005c60 Merge pull request #70 from rschamp/bugfix/new-skins-without-rotationCenter
Calculate rotation center if it's not supplied
2017-01-25 09:43:24 -05:00
Ray Schamp
bf2863921c Carry rotationCenter assignment to create*Skin 2017-01-25 09:29:29 -05:00
Ray Schamp
c478ebec35 Use explicit rotationCenter argument
This is more explicit than the previous behavior, and more in line with the way we supply the costumeResolution
2017-01-25 09:28:58 -05:00