Commit Graph

1089 Commits (8dd671f143f267c8b96c6ff5a1b7e7f569cbb98d)

Author SHA1 Message Date
Isaiah Odhner 439f8cad27 Simplify 2019-11-03 01:48:30 -04:00
Isaiah Odhner d1544d04b5 Show only supported shortcuts in menus
- I hid "Ctrl+W" previously, but Ctrl+R is also destructive.
- And Alt+F4 closes the whole browser window, not just the (web) application.
- For File > New, Ctrl+Alt+N works as an alternative; list that.
- For Image > Clear Image, Ctrl+Shift+N works in Firefox, but opens an incognito window in chrome; add browser detection.
- Ctrl+R, Ctrl+L, Ctrl+T, Ctrl+PgDn, and Ctrl+PgUp are not actually implemented.
- Fix showing Ctrl+G (typo "shorcut")
2019-11-03 01:47:31 -04:00
Isaiah Odhner 024cafaad1 Use less of this
and more of this: ()=> { ... }
2019-11-03 00:27:49 -04:00
Isaiah Odhner 0d61644c17 Clean up 2019-11-01 19:59:16 -04:00
Isaiah Odhner 799a745889 DRY between Select and Text tools 2019-11-01 19:52:21 -04:00
Isaiah Odhner 0891b8748f Remove concept of instantiation from OnCanvasTextBox 2019-11-01 19:02:14 -04:00
Isaiah Odhner 13fa15e7a9 Implement perfect tool previews for Select and Text tools
- Instead of creating an OnCanvasTextbox or OnCanvasSelection object during selection, draw the preview in the tool
- Get it looking exactly like it does in mspaint (as far as I can tell)
- Fix how selection rect is determined
- Don't create textbox or selection if width or height would be 1
- Don't draw unless the pointer has moved
2019-11-01 18:56:49 -04:00
Isaiah Odhner 59f4e9bcce Make constants for changing during dev 2019-11-01 18:39:41 -04:00
Isaiah Odhner 30b602f30f Lebab le vaporwave
lebab --replace help/ --transform let
lebab --replace help/ --transform arrow
2019-10-29 21:48:17 -04:00
Isaiah Odhner 01d120a68e Fix path 2019-10-29 21:38:32 -04:00
Isaiah Odhner 82b5425334 Don't use $.each or $().each 2019-10-29 21:38:32 -04:00
Isaiah Odhner 50730f5e64 Clean up 2019-10-29 20:48:51 -04:00
Isaiah Odhner adc524e241 Fix colors box 2019-10-29 20:41:45 -04:00
Isaiah Odhner f232298a33 Do destructure THIS event param
which is not always an event :)

i.e. this makes it *more* semantic
2019-10-29 18:47:39 -04:00
Isaiah Odhner 469f13ccc3 Use a few object param destructurings
$ lebab --replace src/ --transform destruct-param
src/canvas-change.js:
23:  warning  5 different props found, will not transform more than 4  (destruct-param)

Don't destructure events or elements, or (otherwise) lose important context from the variable name.
2019-10-29 18:42:51 -04:00
Isaiah Odhner 72d4a1fb93 Use object shorthand
lebab --replace src/ --transform obj-shorthand
2019-10-29 18:22:32 -04:00
Isaiah Odhner 08bf5541f8 Use exponent operator
lebab --replace src/ --transform exponent
2019-10-29 18:19:38 -04:00
Isaiah Odhner 21e283317b Doot 2019-10-29 18:17:34 -04:00
Isaiah Odhner a2a6c7d9ef Use default params
lebab --replace src/ --transform default-param
2019-10-29 18:15:45 -04:00
Isaiah Odhner d404b7afd7 Fix whitespace 2019-10-29 18:11:56 -04:00
Isaiah Odhner 83dd05c1b0 Clean up canvas creation
Don't pretend the canvas making helper is a class
2019-10-29 17:49:17 -04:00
Isaiah Odhner ab83621abb Clean up cursor constructing
- Don't pretend like it's a class
- Split a variable definition (which would have been really bad practice if it was actually a class)
- Take args directly instead of in an array
2019-10-29 17:48:47 -04:00
Isaiah Odhner 4d77a04c9e Clean up 2019-10-29 17:28:43 -04:00
Isaiah Odhner 6e130de69e Use template strings
lebab --replace src/ --transform template
2019-10-29 17:16:33 -04:00
Isaiah Odhner d0f4b08690 Fix lint 2019-10-29 17:08:13 -04:00
Isaiah Odhner ad24e53e65 Fix indentation 2019-10-29 17:00:31 -04:00
Isaiah Odhner 231f4bc79d Convert some for loops to for-of
$ lebab --replace src/ --transform for-of
src/extra-tools.js:
34:  warning  Unable to transform for loop  (for-of)
89:  warning  Unable to transform for loop  (for-of)
src/functions.js:
291:  warning  Unable to transform for loop  (for-of)
796:  warning  Unable to transform for loop  (for-of)
1095:  warning  Unable to transform for loop  (for-of)
1123:  warning  Unable to transform for loop  (for-of)
1128:  warning  Unable to transform for loop  (for-of)
1138:  warning  Unable to transform for loop  (for-of)
1190:  warning  Unable to transform for loop  (for-of)
1221:  warning  Unable to transform for loop  (for-of)
1222:  warning  Unable to transform for loop  (for-of)
1245:  warning  Unable to transform for loop  (for-of)
1249:  warning  Unable to transform for loop  (for-of)
src/image-manipulation.js:
48:  warning  Unable to transform for loop  (for-of)
74:  warning  Unable to transform for loop  (for-of)
337:  warning  Unable to transform for loop  (for-of)
558:  warning  Unable to transform for loop  (for-of)
604:  warning  Unable to transform for loop  (for-of)
672:  warning  Index variable used in for-loop body  (for-of)
675:  warning  Unable to transform for loop  (for-of)
831:  warning  Unable to transform for loop  (for-of)
848:  warning  Unable to transform for loop  (for-of)
877:  warning  Unable to transform for loop  (for-of)
src/OnCanvasSelection.js:
132:  warning  Unable to transform for loop  (for-of)
176:  warning  Unable to transform for loop  (for-of)
src/OnCanvasTextBox.js:
134:  warning  Unable to transform for loop  (for-of)
src/simulate-random-gestures.js:
94:  warning  Unable to transform for loop  (for-of)
111:  warning  Unable to transform for loop  (for-of)
src/storage.js:
22:  warning  Unable to transform for loop  (for-of)
src/tool-options.js:
40:  warning  Unable to transform for loop  (for-of)
58:  warning  Unable to transform for loop  (for-of)
src/tools.js:
75:  warning  Unable to transform for loop  (for-of)
251:  warning  Unable to transform for loop  (for-of)
389:  warning  Unable to transform for loop  (for-of)
393:  warning  Unable to transform for loop  (for-of)
508:  warning  Unable to transform for loop  (for-of)
2019-10-29 16:53:16 -04:00
Isaiah Odhner 01b9728bfd Fix things and clean up 2019-10-29 16:46:51 -04:00
Isaiah Odhner af6e9a1242 Convert var to let and const
$ lebab --replace src/ --transform let
src/$Component.js:
59:   warning  Unable to transform var  (let)
60:   warning  Unable to transform var  (let)
97:   warning  Unable to transform var  (let)
138:  warning  Unable to transform var  (let)
src/$Window.js:
74:   warning  Unable to transform var  (let)
src/app.js:
662:  warning  Unable to transform var  (let)
460:  warning  Unable to transform var  (let)
612:  warning  Unable to transform var  (let)
613:  warning  Unable to transform var  (let)
614:  warning  Unable to transform var  (let)
src/functions.js:
756:  warning  Unable to transform var  (let)
src/image-manipulation.js:
245:  warning  Unable to transform var  (let)
826:  warning  Unable to transform var  (let)
src/imgur.js:
48:   warning  Unable to transform var  (let)
173:  warning  Unable to transform var  (let)
2019-10-29 16:46:51 -04:00
Isaiah Odhner 089678b59b Replace indexOf with includes
lebab --replace src/ --transform includes
2019-10-29 16:46:51 -04:00
Isaiah Odhner e9ac10e89a Clean up 2019-10-29 16:46:51 -04:00
Isaiah Odhner d61a011021 Convert object methods
lebab --replace src/ --transform obj-method
2019-10-29 16:46:51 -04:00
Isaiah Odhner dd8193888a Convert return in arrow functions
lebab --replace src/ --transform arrow-return
2019-10-29 16:46:51 -04:00
Isaiah Odhner 00829ba45d Convert spaces to tabs 2019-10-29 16:46:51 -04:00
Isaiah Odhner 9cd53dca24 Replace `var that = this` patterns 2019-10-29 16:46:51 -04:00
Isaiah Odhner cf0f82ad87 Rewrite things that used `arguments` 2019-10-29 14:57:22 -04:00
Isaiah Odhner d0e722d12c Convert to arrow functions with lebab
npm install -g lebab@3.1.0

lebab --replace src/ --transform arrow
2019-10-29 14:46:29 -04:00
Isaiah Odhner 789bc07035 Convert to ES6 classes 2019-10-29 14:43:10 -04:00
Isaiah Odhner 2ef129f95b Describe 2019-10-28 20:09:30 -04:00
Isaiah Odhner 1127b53d72 Always render helper layer at screen pixel scale
- Always use screen pixel scale for helper layer
- Move responsibility for non-integer handling into draw_grid (instead of using an integer scale for the whole helper layer)
- This allows the Magnifier viewport preview and Eraser preview to draw with a consistent line width
- TODO: Try applying sub-1px margin or padding or left/top or translate or something to canvas-area to get helper layer canvas to line up with screen pixels perfectly
2019-10-28 19:42:36 -04:00
Isaiah Odhner b30fcb753d Fix helper layer visibility with sub-100% browser zoom 2019-10-28 18:01:16 -04:00
Isaiah Odhner 8e56cace11 Remove keyCode finder 2019-10-28 17:16:52 -04:00
Isaiah Odhner af68c6fe00 Fix dynamic cursor updating on scroll and zoom
(broken in 953107a65c)
2019-10-28 16:46:25 -04:00
Isaiah Odhner cca792e9a3 Replace README screenshot 2019-10-28 15:17:30 -04:00
Isaiah Odhner 17de847369 Tweak README 2019-10-28 14:46:03 -04:00
Isaiah Odhner 0ec6efc3ee Make dynamic cursors update properly in Draw Randomly 2019-10-28 14:21:51 -04:00
Isaiah Odhner a1f9b59bd7 Add command key support for macOS 2019-10-28 12:57:56 -04:00
Isaiah Odhner 9d0ab21d54 Update help 2019-10-27 17:26:34 -04:00
Isaiah Odhner 622f9f8dda Blend swatch border with swatch color
Make the border go on top of the swatches so it blends with them and doesn't just create an ugly gray around them.
(It especially looked bad on the orange in the corner, which is around the same perceptive brightness as the gray.)
2019-10-27 14:38:15 -04:00
Isaiah Odhner 38a16604cd Improve modern theme
- Use modern sprites for tool icons and transparency options
- Use modern selection color for tool options
- Add a border around the canvas area to separate the canvas from the UI
- Slightly round the corners of the color wells and selected colors
2019-10-27 14:24:10 -04:00