Commit graph

337 commits

Author SHA1 Message Date
Paul Kaplan
a9ba5eac9b Protect against drawing zero sized images, fixing Firefox crashes (#495)
* Protect against drawing zero sized images, fixing Firefox crashes

* Remove removing raster

Let the layer.js helper manage the raster object
2018-06-07 10:19:06 -04:00
DD Liu
44f71d9f72
Fix drawing rectangle while holding shift (#493) 2018-06-07 10:01:23 -04:00
DD Liu
63198c05b4
Fix firefox wrap and opaque text selection (#474) 2018-05-24 14:16:00 -04:00
DD Liu
09babb15c5
Safety check cursor preview (#470) 2018-05-23 16:39:18 -04:00
DD Liu
f9e00afdc8
Dont translate fonts and increase default font size (#450)
* Remove internationalization from all font names
* Bump up the default font sizes
2018-05-17 15:34:36 -04:00
DD Liu
0240abcfe3
Font tool (#443)
Add font picker
2018-05-17 10:37:02 -04:00
DD Liu
89133f42e5
Update import and export types (#412)
* Import/export bitmap
* Fix playground and readme
* Use constants instead of changing zoom level for every import/export
2018-05-01 16:18:24 -04:00
DD Liu
3d99044ccf
Import and export bitmaps (#404)
* Rename svg to image

* Import/export bitmap

* Fix playground and readme

* Fix lint

* Assume strings are svgs
2018-04-26 18:45:50 -04:00
DD
ed114bb073 Move getBrushMark to helper 2018-04-26 14:54:44 -04:00
DD Liu
0755df9990 Add line tool 2018-04-25 15:26:48 -04:00
DD
f08c3e140f Fix merge 2018-04-20 11:27:09 -04:00
DD
bec01149ea Fix review comments 2018-04-20 11:20:38 -04:00
DD Liu
8d55265de1 Double resolution on import and halve on export 2018-04-20 11:17:42 -04:00
DD Liu
99534eb24c
Merge pull request #387 from fsih/raster
Bitmap brush
2018-04-20 11:05:44 -04:00
DD
88c9f17998 fix review comments 2018-04-20 10:57:10 -04:00
DD
d6111ed031 Remove unused code 2018-04-17 15:01:10 -04:00
DD
bda357bca6 Delete extra tools 2018-04-17 14:57:50 -04:00
DD
87d9386906 Allow odd numbers for very small brush sizes for detail 2018-04-17 14:51:34 -04:00
DD
ca42dc7735 Double pixel brush drawin working 2018-04-13 11:33:47 -04:00
Jacco Kulman
507047e245 Fix whitespace 2018-04-13 11:33:04 +02:00
Jacco Kulman
71e01dd9c4 Escape end text edit mode 2018-04-13 08:16:43 +02:00
DD
420e1013cf Use a separate state to track the size of the bitmap brush tool from the brush tool 2018-04-12 16:56:54 -04:00
DD
9c84537a42 Switch tools when switching editors. Pipe through vector brush size for now. 2018-04-12 10:56:16 -04:00
DD
7855ae8893 Merge branch 'develop' into raster 2018-04-11 18:05:13 -04:00
DD Liu
bf1d4ca82a
Merge pull request #370 from fsih/convertToBitmap
Convert to bitmap
2018-04-11 15:50:18 -04:00
DD Liu
6252366759
Merge pull request #360 from fsih/fillTransparentText
Add ability to fill transparent text
2018-04-11 14:45:56 -04:00
DD Liu
e14198faea
Merge pull request #369 from fsih/boundingBoxToolOnNoSelection
Make sure to remove the bounding box when no items are selected
2018-04-11 14:32:18 -04:00
DD
41a68b1aea Merge branch 'develop' into convertToBitmap 2018-04-11 10:36:14 -04:00
DD
a74e5882cd Rename undo formats, and make format change on costume change skip convert 2018-04-10 18:02:44 -04:00
DD
40871b1c0f Rename undo formats, and make format change on costume change skip convert 2018-04-10 18:02:30 -04:00
DD
c6a282c97b Add ellipse drawing algorithm and temp brush canvas for efficiency 2018-04-10 14:24:36 -04:00
DD Liu
887f528b0a allow transparent paintbrush 2018-04-10 14:24:36 -04:00
DD Liu
80b4557741 Add size, remove alias from other canvases 2018-04-10 14:24:36 -04:00
DD Liu
ba51fe59a0 Draw lines. Fix raster layer missing when changing costumes. 2018-04-10 14:24:36 -04:00
DD
31561d8bda Add bitmap brush tool button 2018-04-10 14:22:47 -04:00
DD
9a5a273f5b drawing some dots 2018-04-10 14:22:47 -04:00
DD Liu
f8414c3cb9
Merge pull request #368 from Jacco/issue/155
Replace png background with vector version (for #155)
2018-04-10 11:20:14 -04:00
DD
2b267ba6e9 Fix tests 2018-04-10 10:38:55 -04:00
DD
8ffe666478 Merge branch 'develop' into convertToBitmap 2018-04-09 20:11:57 -04:00
DD
a6e7fb4251 update button state when undoing between modes, hide vector tools 2018-04-09 20:10:53 -04:00
DD
e5c582f86b Make sure to remove the bounding box when no items are selected 2018-04-09 17:49:39 -04:00
DD
6e4ab3191a Get undo/redo working 2018-04-09 17:47:11 -04:00
DD Liu
6d11c9988a
Merge pull request #356 from fsih/eraserDisappears
Bring back eraser after snapshot
2018-04-09 13:25:12 -04:00
Jacco Kulman
0753b7ccc1 Added a comment (TRAVIS took wrong version) 2018-04-07 08:42:32 +02:00
Jacco Kulman
d0536be3ae Fixes (const instead of let) to satisfy TRAVIS 2018-04-07 08:25:33 +02:00
Jacco Kulman
b7f0551fac Fixes (whitespace, semicolons) to satisfy TRAVIS 2018-04-07 08:20:59 +02:00
Jacco Kulman
e64f015489 Replace png background with vector version 2018-04-07 07:59:52 +02:00
DD
15053d15f0 convert to vector on button press 2018-04-06 16:57:59 -04:00
DD
94ae07f1f2 Bitmap button rasterizes 2018-04-06 16:23:43 -04:00
DD
436bad4826 fix nudge 2018-04-06 10:57:40 -04:00
DD
82d2e30cae Add raster layer 2018-04-05 17:37:40 -04:00
DD
aff5866391 Remove unneeded applyMatrix 2018-04-04 14:50:11 -04:00
DD Liu
2e5aee5ff5
Merge pull request #359 from Jacco/issue/332
Issue/332 Rotate-tool fix
2018-04-04 14:42:19 -04:00
Jacco Kulman
c0c3531e4c Fixed issue with simplification 2018-04-04 19:36:58 +02:00
DD Liu
6c6d3a8bfb
Merge pull request #337 from Jacco/issue/301
Reduce target when fill hole with same color #301
2018-04-03 18:56:58 -04:00
DD
2b840c2f47 Add ability to fill transparent text 2018-04-03 18:21:12 -04:00
Jacco Kulman
c9d5b7d3a7 Ungrouping should not reduce CompoundPaths with 1 child 2018-04-03 23:12:24 +02:00
Jacco Kulman
e4c73da4ba Trailing space removed (Travis fix) 2018-04-03 22:54:36 +02:00
Jacco Kulman
f544a5e1f6 Simplification wwas incomplete 2018-04-03 22:36:49 +02:00
Jacco Kulman
ffc1da3b8e Rotation tool shift fix + simplification 2018-04-03 22:32:46 +02:00
DD
1a2c297c7b bring back eraser after snapshot 2018-04-02 18:50:35 -04:00
Paul Kaplan
769c6560e4 Fix leading 2018-03-29 15:58:22 -04:00
Paul Kaplan
5c0219e745 Use scratch 2 default font 2018-03-29 11:46:02 -04:00
Paul Kaplan
42abd4a33c
Merge pull request #336 from Jacco/issue/179
Line connect guide size remains same when zooming #179
2018-03-28 08:58:15 -04:00
Paul Kaplan
af2c49e639 Fix double clicking to enter edit mode and clearing selection.
The first was caused by the "lastMode" flag being stored after the
double click edit was done, causing it to immediately exit edit mode.
The second problem was that the selection should be cleared when
entering edit mode on another text area.
2018-03-26 11:23:55 -04:00
Jacco Kulman
a98ba28152 Fix 2 TRAVIS errors (whitespace, let) 2018-03-26 14:53:33 +02:00
Jacco Kulman
f707af70fd When removing a hole, the parent should be reduced before fillColor is set 2018-03-26 13:46:25 +02:00
Jacco Kulman
0198265fb8 The radius of the circle is now divided by paper.view.zoom, and the strokeWidth also. (Fixes #179) 2018-03-26 13:30:11 +02:00
DD
b98708ff70 Make clicking outside of the canvas activate select mode. This way the user can change the fill color easily, instead of the text getting deselected as soon as they click fill. 2018-03-22 17:56:54 -04:00
DD
6bfc3f23df Don't apply outline to text by default 2018-03-22 17:53:17 -04:00
DD
baf628c5c9 Detect view bounds changes and update the edit text matrix in response 2018-03-22 15:23:51 -04:00
DD
0c4f545326 Add transform when zoomed in 2018-03-22 14:34:46 -04:00
DD
c75d3f63ba Add undo 2018-03-22 14:31:03 -04:00
DD Liu
86ee3d8cdd Edit text moves with text transform 2018-03-22 11:07:10 -04:00
DD
1d29a7dceb Showing text on top of other text 2018-03-20 17:26:27 -04:00
DD
da0864b81b Add a text edit area 2018-03-20 14:47:14 -04:00
DD Liu
724fe85645
Merge pull request #325 from fsih/unfocusText
Unfocus text fields when canvas clicked and don't take keystrokes in canvas when text fields are focused
2018-03-20 14:06:59 -04:00
DD
44eedfe225 Remove unnecessary changes 2018-03-19 14:50:05 -04:00
DD
b4294b8268 Merge branch 'develop' into textTool 2018-03-19 12:43:44 -04:00
DD
a03567ef18 Switch to .1 2018-03-16 14:23:59 -04:00
DD
69e73d45dd Use .25 2018-03-16 14:18:42 -04:00
DD
79e7d21023 Change proptype 2018-03-16 14:16:27 -04:00
DD
8d61a7b060 Move the text edit target to the state and make fill work 2018-03-16 11:39:09 -04:00
DD
7a0a0784e1 Unfocus text fields when canvas clicked 2018-03-15 13:23:03 -04:00
DD
de0f12074d Unfocus text fields when canvas clicked 2018-03-15 13:20:07 -04:00
DD
254bbe1285 Ignore nudge when text field focused 2018-03-15 13:19:05 -04:00
DD
76eb0b9e3e Reduce the overlap to .25 2018-03-14 18:12:37 -04:00
DD
f9aabe1beb Fix some bugs 2018-03-14 18:00:38 -04:00
DD
240282f9d2 Make the guide stay in the shape of the text when text is rotated 2018-03-14 16:01:20 -04:00
DD
f0b570dc51 Add dotted lines in text edit mode 2018-03-14 15:28:22 -04:00
DD
4fd9f991f1 Mode switching 2018-03-14 14:43:39 -04:00
DD
8e86222097 Basic text edit 2018-03-12 17:51:23 -04:00
DD
8e7ae67ae6 Make the text tool a real tool 2018-03-09 14:40:34 -05:00
DD
ccdb6431b5 Merge branch 'develop' into brushEfficiency 2018-03-08 11:43:50 -05:00
DD Liu
eff43e2eec
Merge pull request #304 from fsih/removePaperUpdate
Remove all view.draw and view.update
2018-03-06 16:24:45 -05:00
DD
43b0bf40e5 Add jsdoc 2018-03-02 10:38:35 -05:00
DD
5783b69f0a Don't error if there are no segments 2018-03-01 17:14:09 -05:00
DD
0323451ebf Fix crash when missing cursor preview 2018-03-01 16:37:45 -05:00
DD
24b1359abf Make mouse movement accuracy depend on zoom level 2018-03-01 15:26:22 -05:00
DD
abe8deaa35 Make sure to clear the cursor preview when saving undo state so that it doesnt mysteriously return on undo 2018-03-01 14:41:39 -05:00
DD
9a8c68e9d1 Remove all view.draw and view.update 2018-03-01 14:32:16 -05:00
DD
b064db5309 add comments 2018-03-01 14:27:10 -05:00
DD
0943d8d0a1 Add end caps to round out flat edges. Significantly increase the threshold for using broad brush helper now that its able to handle end caps better. Also make the threshold depend on zoom level. 2018-03-01 14:22:34 -05:00
DD
f9a9aa8feb drawing caps and fixing bugs 2018-02-28 20:06:51 -05:00
DD
5aca0c83a2 Clean up amortized simplify 2018-02-28 18:23:54 -05:00
DD
64e628576b Remove all view.updates 2018-02-28 15:20:24 -05:00
DD
7d56dc6829 amortized smoothing 2018-02-27 11:22:38 -05:00
DD
9ab90d1576 periodic smoothing 2018-02-27 11:22:38 -05:00
DD
24032192c8 remove cursor preview when drawing and paper.view.draw 2018-02-27 11:22:38 -05:00
Paul Kaplan
13d0f13170
Merge pull request #289 from paulkaplan/fix-zoom-bounds
Change pan/zoom bounds to 360/480 to match the real bounds.
2018-02-08 11:10:14 -05:00
Paul Kaplan
b4b93a4982 Change pan/zoom bounds to 360/480 to match the real bounds. 2018-02-08 08:49:52 -05:00
Paul Kaplan
c87e3e021a
Merge pull request #283 from paulkaplan/fix-chrome-eyedropper-bug
Temporary fix for eyedropper issue in Chrome 64
2018-02-07 12:37:58 -05:00
Paul Kaplan
d648fef0ee
Merge pull request #285 from paulkaplan/fix-input-nudging
Don't nudge selection when input is focused
2018-02-07 12:32:44 -05:00
Paul Kaplan
7f83411653 Use the same syntax as the delete key 2018-02-07 11:35:59 -05:00
Paul Kaplan
09145a3bf1 Bail if input is target of nudge 2018-02-06 20:14:58 -05:00
Paul Kaplan
3a1e88eb5e Only update the selection bounds if a nudge actually occurs
This was causing the problem where holding shift while dragging would
trigger the selection box to be shown, interrupting the drag.
2018-02-06 19:15:25 -05:00
Paul Kaplan
270c92a849 Buffer the paper canvas offscreen for picking to ensure safe access.
This gets around the bug #276 where chrome cannot handle getImageData
off a canvas on HDPI screens. In the interest of having a single
code-path, and because does not impose a large performance burden, I
think we should just use it for all platforms until chrome is really
fixed.

Also it is important to note that because this bug has to do with how
they handle accelerated 2d canvas contexts, it does not impact the stage
color picking, so that does not need to be changed.
2018-02-06 18:56:26 -05:00
DD
53927bf615 Move key handlers into their own file, and add to oval and rect tools 2018-01-25 16:39:38 -05:00
DD
f3dcc54bf3 nudge 2018-01-25 16:00:50 -05:00
DD
8439a6387e Clean up the cursor preview when it is removed from its parent 2018-01-11 18:50:42 -05:00
DD
300bbc80f3 Run ensure clockwise after flip, since flip makes everything counterclockwise which breaks fill 2017-12-22 17:44:14 -05:00
DD
db5ddcbe87 Change handle ratio to make squares circles 2017-12-22 11:32:06 -05:00
DD
07b30aa55b Handle pointed and curved 2017-12-21 15:38:24 -05:00
DD Liu
7086916089
Merge pull request #238 from fsih/handleLength
Don't change opposite handle length when changing handle length
2017-12-20 13:35:07 -05:00
DD
e199c0f39d Don't change opposite handle length when changing handle length 2017-12-20 12:11:17 -05:00
DD
31200665c0 Remove the bounds path when you finish scaling 2017-12-19 17:10:55 -05:00
DD
0fe9c5d453 Make boolean expression more readable 2017-12-19 16:38:44 -05:00
DD
9c98507597 Take out fill-caused grouping 2017-12-19 13:47:39 -05:00
DD
80a5238461 Fix a bug where when we reduce a compound path, the child doesnt inherit the style 2017-12-19 13:47:39 -05:00
DD
bda56d0a41 Add the right icon 2017-12-19 13:47:39 -05:00
DD
814ec160b3 Fill tool for fills (not strokes) 2017-12-19 13:47:39 -05:00
DD
045dcf211c Expand filled holes by 1 px to avoid a gap between fill and outline 2017-12-19 13:47:39 -05:00
DD
207341f47f Basic fill tool 2017-12-19 13:47:39 -05:00
DD Liu
9b5383eb50
Merge pull request #231 from fsih/fillWithTransparent
Null checks for fill with transparent
2017-12-19 13:34:29 -05:00
DD
45dea42863 merge match stroke color and match fill color 2017-12-19 13:19:01 -05:00
DD
b8c0b29aea Null checks for fill with transparent 2017-12-19 11:59:54 -05:00
DD Liu
482c994112
Merge pull request #222 from fsih/showOutline
Show bounding box outline when moving and scaling in the select tool
2017-12-19 11:07:13 -05:00
DD
8dbed6ff77 When a piece of a compound path is selected, treat it as the whole compound path. 2017-12-18 12:02:35 -05:00
Matthew Taylor
21dc3a4b7f
Merge pull request #212 from mewtaylor/issue/gh-147
Implement eye dropper for paint editor
2017-12-15 11:04:54 -05:00
Matthew Taylor
7df3d69fc6 small styling updates
make the swatches aligned in gui, and make sure the cursor shows when not eye dropping. Also moves eye dropper initialization into the helper. Thanks @paulkaplan!
2017-12-15 10:37:31 -05:00
DD
ac6914afc4 Show bounding box when moving and scaling in the select tool 2017-12-14 19:17:06 -05:00
Matthew Taylor
0209e65ac0 accommodate zoom in eye dropper 2017-12-14 12:58:25 -05:00
Matthew Taylor
ae0358079e use pixelRatio instead of scale constant
Turns out that the width/height paper sets on the canvas is tracked at scale to the width/height we set in the `pixelRatio` value, so use that to handle grabbing pixel color rather than a constant we set.
2017-12-13 13:13:43 -05:00
DD
e9392d4b2b Remove template 2017-12-12 12:23:02 -05:00
DD
accdbb0fc3 Selection box handle design 2017-12-12 11:42:19 -05:00
Matthew Taylor
4accabbc69 Changes from PR feedback
fixes lint and gui compatibility issues shown by @paulkaplan, and also does some cleanup to references and structure as requested by @fsih. Thanks to both of you for the reviews!

FYI – part of the canvas reference change made it so that the `PaintEditor` presentation component could become a classless declaration.
2017-12-11 13:24:57 -05:00
Matthew Taylor
2183dc759f Implement eye dropper for paint editor 2017-12-08 16:52:37 -05:00
DD
54f8abacfc Show the bounding box after switching to select tool and transforming 2017-12-05 12:13:31 -05:00
Matthew Taylor
5ffdd14ff0
Merge pull request #194 from mewtaylor/issue/gh-41
Implement GH-41: Add minimum width gui
2017-11-21 11:06:05 -05:00
DD
420db40145 Improve cursor preview, don't redraw the circle every frame it changes 2017-11-08 15:36:21 -05:00