979 Commits

Author SHA1 Message Date
Paul Kaplan
8a1f3306b7 Check if x has been incremented to OR above the width.
Fixes a bug with the convex hull calculation where the bounds could not
be calculated for certain costumes with non-integer sizes.
2017-12-01 08:56:12 -05:00
Christopher Willis-Ford
9307e09031 Use bilinear filtering except when we shouldn't
Use bilinear filtering unless the Drawable is angled by a multiple of 90
degrees and is either a raster image (like a BitmapSkin) or is around
its native resoluion. This makes both bitmaps and vectors look better in
most cases. This is roughly the same logic that Scratch 2.0 used; we may
want to tweak it over time to see if we can make it even better.
2017-11-29 20:55:50 -08:00
greenkeeper[bot]
e2bce19b22 chore(package): update tap to version 11.0.0 2017-11-26 01:02:13 +00:00
Chris Willis-Ford
72af98d2cf
Merge pull request #193 from griffpatch/touching-color-white
Touching color white always returns "true"
2017-11-20 17:25:42 -08:00
Chris Willis-Ford
8495c6c4e2
Merge pull request #196 from mzgoddard/alpha-shape
Emulate silhouette rendering for pick and _getConvexHullPointsForDrawable
2017-11-20 13:29:39 -08:00
Michael "Z" Goddard
59f6492742
Use isTouching methods in RenderWebGL.pick and getConvexHull
Use Drawable.isTouching and Skin.isTouching to implement pick and
_getConvexHullPointsForDrawable to emulate rendering the drawable's
silhouette and determining what is picked or the points for a convex
hull.
2017-11-20 14:00:37 -05:00
Michael "Z" Goddard
8bdf56705e
Add Drawable.isTouching
Use EffectTransform and Skin.isTouching to implement
Drawable.isTouching.

Drawable.isTouching takes a world coordinate.
2017-11-20 13:46:34 -05:00
Paul Kaplan
d7d5e75567
Merge pull request #199 from paulkaplan/fix-webpack-dev-server
Fix webpack dev server
2017-11-17 12:32:26 -05:00
Paul Kaplan
1c879f11e2 Include production=false in install 2017-11-17 11:48:56 -05:00
Paul Kaplan
0d40cc0199 Add node env to travis yml 2017-11-17 10:08:02 -05:00
Paul Kaplan
067eb1940d Only uglify if building for production.
Uglify was trying to run always, including the dev-server output, which
included es6 that broke uglifier.
2017-11-17 10:04:57 -05:00
Chris Willis-Ford
77e3d63da9
Merge pull request #195 from mzgoddard/whirl-fisheye-without-condition
Whirl and Fisheye shaders without conditions
2017-11-16 16:47:17 -08:00
Chris Willis-Ford
d99176bb5f
Merge pull request #197 from cwillisf/fix-ifyloader-windows
Fix ify-loader test on Windows / Cygwin
2017-11-16 12:00:38 -08:00
Ray Schamp
0f69cb7f7c
perf(setRotationCenter): compare new setRotationCenter values after truncating to 32bit
Compare new setRotationCenter values after truncating to 32bit
2017-11-16 09:45:06 -05:00
griffpatch
10762c7f7c Fix misunderstanding of mask3b now that I can bypass the build failure and test 2017-11-16 08:33:10 +00:00
Christopher Willis-Ford
c3445971fd Fix ify-loader test on Windows / Cygwin
On Windows and Cygwin the path to JS source files may contain
backslashes, forward slashes, or a mix. The regex used to test whether
or not to use `ify-loader` contains path separators; this change allows
either slash instead of requiring only forward slashes.
2017-11-15 17:20:54 -08:00
Michael "Z" Goddard
a0df7153bc
Add Skin.isTouching
Use Silhouette to implement Skin.isTouching in subclasses.
2017-11-15 17:41:46 -05:00
Michael "Z" Goddard
448c88e637
Add EffectTransform
EffectTransform transforms a point based on a Drawable's effect uniform
values mimicking the texcoord0 transformation in the shader. This way a
point in the Drawable space can know if its touching its silhouette
when the Drawable has effects active.
2017-11-15 17:41:46 -05:00
Michael "Z" Goddard
1926b49ebc
Add Silhouette class
Silhouette emulates silhouette rendering. Performing tests like
RenderWebGL.pick can use Silhouette in place of reading a silhouette
rendering from the GPU.

Silhouette.isTouching(vec) takes a texture coordinate vector and checks
if the corresponding location is opaque or not for the underlying
information.
2017-11-15 17:39:59 -05:00
Michael "Z" Goddard
08e4523324
Change the fisheye shader so it does not need a conditional 2017-11-15 14:05:26 -05:00
Michael "Z" Goddard
1c9f148923
Change whirl shader so it does not need a conditional 2017-11-15 14:05:25 -05:00
griffpatch
539eb4ce05 Lint issues 2017-11-14 08:32:53 +00:00
griffpatch
3380aa938f Fix for Touching color white always returns "true" #710
So the issue is simple... We start by filling the detector canvas with
the color white, then layer over this the costumes we are want to detect
white colors in (but clip to the shape of the costumre we are detecting
against) then the areas that were clipped will still be white (the
background fill color). So we detect white no matter what.
2017-11-14 08:29:01 +00:00
Michael "Z" Goddard
b060c07db1
Compare new setRotationCenter values after truncating to 32bit
`Skin._rotationCenter` is a twgl vector or said another way a
Float32Array. JavaScript casts values stored in this array as 32 bit
floats instead of JavaScript's standard 64 bit floats. Comparing the
equality, like `setRotationCenter` does, of a 64 bit float against a
value stored in a 32 bit container will virtually always be false.
Truncating the new value into a 32 bit (losing precision) will give a
more useful comparison and remove a lot of current false positives.
2017-11-07 17:33:21 -05:00
Paul Kaplan
998d3e129a Merge pull request #181 from paulkaplan/fix-stroke-measurement
Use zero if cannot parse stroke width
2017-10-12 16:33:09 -04:00
Paul Kaplan
be1306387d Use zero if cannot parse stroke width 2017-10-12 15:59:45 -04:00
Paul Kaplan
b84721d5b3 Merge pull request #177 from paulkaplan/say-think
Say/think bubble SVG templates
2017-10-11 14:19:53 -04:00
Paul Kaplan
04e9d6c414 Change toString to buildString 2017-10-11 13:41:42 -04:00
Paul Kaplan
f989c80f20 Merge pull request #176 from paulkaplan/text-wrapping
Add utils for text wrapping, originally by CWF
2017-10-11 13:32:17 -04:00
Paul Kaplan
69ae065b92 Text bubble rendering 2017-10-10 09:09:23 -04:00
Paul Kaplan
ebe2db2e02 Add utils for text wrapping, originally by CWF 2017-10-10 09:06:38 -04:00
Paul Kaplan
0b3e7c37c2 Merge pull request #179 from paulkaplan/fix-bbox-strokes
Enlarge bounding box by the largest stroke width.
2017-10-06 16:28:51 -04:00
Paul Kaplan
ab4046b852 Only enlarge by half stroke width on either side 2017-10-05 13:30:01 -04:00
Paul Kaplan
3565c95f83 Enlarge bounding box by largest stroke width. 2017-10-05 11:03:23 -04:00
greenkeeper[bot]
b2b3e815b6 chore(package): update eslint-config-scratch to version 5.0.0 2017-10-05 14:05:10 +00:00
Chris Willis-Ford
77c163e569 Merge pull request #173 from LLK/greenkeeper/webpack-dev-server-2.8.2
chore(package): update webpack-dev-server to version 2.8.2
2017-09-18 12:38:11 -07:00
greenkeeper[bot]
ecbf91039c chore(package): update webpack-dev-server to version 2.8.2 2017-09-14 19:51:36 +00:00
Chris Willis-Ford
93aa64c89f Merge pull request #171 from LLK/greenkeeper/twgl.js-3.7.0
Update twgl.js to the latest version 🚀
2017-09-14 12:32:03 -07:00
Chris Willis-Ford
1b282ea5d0 Merge pull request #170 from LLK/greenkeeper/babel-eslint-8.0.0
Update babel-eslint to the latest version 🚀
2017-09-14 12:28:43 -07:00
greenkeeper[bot]
ecfc6429b8 chore(package): update jsdoc to version 3.5.5 2017-09-14 03:15:59 +00:00
greenkeeper[bot]
303a1840ef chore(package): update twgl.js to version 3.7.0 2017-09-13 14:06:52 +00:00
greenkeeper[bot]
9368724da5 chore(package): update babel-eslint to version 8.0.0 2017-09-12 17:31:06 +00:00
Chris Willis-Ford
c0d0e78bbb Merge pull request #162 from joshlory/color-touching-tolerance
Match Scratch 2.0 threshold for `isTouchingColor`
2017-09-06 17:48:12 -06:00
Chris Willis-Ford
2a9aee5014 Merge pull request #167 from LLK/greenkeeper/twgl.js-3.5.0
chore(package): update twgl.js to version 3.5.0
2017-09-06 17:42:16 -06:00
Chris Willis-Ford
1e54b1c894 Merge branch 'develop' into greenkeeper/twgl.js-3.5.0 2017-09-06 16:17:26 -06:00
Chris Willis-Ford
8248eb498d Merge pull request #166 from LLK/greenkeeper/webpack-3.5.6
chore(package): update webpack to version 3.5.6
2017-09-06 16:08:15 -06:00
Chris Willis-Ford
e60c0202d8 Merge pull request #140 from LLK/greenkeeper/gh-pages-1.0.0
Update gh-pages to the latest version 🚀
2017-09-06 16:01:56 -06:00
Chris Willis-Ford
c9b760c869 Merge branch 'develop' into greenkeeper/gh-pages-1.0.0 2017-09-06 15:55:19 -06:00
Chris Willis-Ford
5d5ac5d66b Merge pull request #157 from LLK/greenkeeper/eslint-config-scratch-4.0.0
Update eslint-config-scratch to the latest version 🚀
2017-09-06 15:54:00 -06:00
Christopher Willis-Ford
737a94b04b Lint fixes 2017-09-06 15:50:01 -06:00