Commit Graph

94 Commits (8584debfe674c5afad8593c7c9b403cd168580ad)

Author SHA1 Message Date
Isaiah Odhner be216e5aad Add action icon for Invert 2019-12-21 00:38:11 -05:00
Isaiah Odhner f9069fd8ab DRY image inversion code 2019-12-21 00:38:10 -05:00
Isaiah Odhner 3e2146adaa Mark selection transformations as soft 2019-12-21 00:38:05 -05:00
Isaiah Odhner d19d2a80d5 Clean up and guard console logs 2019-12-21 00:38:00 -05:00
Isaiah Odhner 1d9f56d0d4 Restructure arguments to undoable() 2019-12-21 00:37:50 -05:00
Isaiah Odhner bc3a450c47 Include selection and selection operations in history 2019-12-21 00:37:46 -05:00
Isaiah Odhner 6d7220f60e Re-enable line drawing >1px width 2019-12-21 00:37:29 -05:00
Isaiah Odhner 9a72ee964f Stamp to make brush/pencil whole again 2019-12-21 00:37:26 -05:00
Isaiah Odhner b1335343d6 WIP: optimize brush, pencil, & eraser performance
The plan is to try drawing a set of lines with WebGL based on the border of the shape of the brush.
2019-12-21 00:37:20 -05:00
Isaiah Odhner 703fcd6105 Get rid of canvas-change.js
- Remove the whole ugly hacky module. Most things only modify the canvas when creating undoables now. Only a few things modify undoables after creating them.
- Formally disable pointer operations playback, instead of just leaving it accidentally disabled.
2019-12-21 00:37:15 -05:00
Isaiah Odhner dae22f837f Improve WebGL context loss handling 2019-12-08 23:00:35 -05:00
Isaiah Odhner 987d6e8d4c More detail! 2019-12-08 13:07:27 -05:00
Isaiah Odhner 85e8922c08 Name undoables with details 2019-12-08 13:07:27 -05:00
Isaiah Odhner a862d5b7b8 Name undoables 2019-12-08 11:52:12 -05:00
Isaiah Odhner f4fb65ee88 Remove redo data deletion dialog 2019-12-08 10:52:06 -05:00
Isaiah Odhner 0e3e90e170 Simplify
- Break out contents of poorly named function (punction?) "this_ones_a_frame_changer"
- Remove need for setTimeout
2019-12-08 10:45:08 -05:00
Isaiah Odhner ecb6b8003d Add support check for Edge
https://developer.mozilla.org/en-US/docs/Web/API/CanvasPattern/setTransform
2019-12-04 13:46:45 -05:00
Isaiah Odhner 593cddac09 Clean up
No more "var" declarations
2019-11-03 10:39:48 -05: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 a2a6c7d9ef Use default params
lebab --replace src/ --transform default-param
2019-10-29 18:15:45 -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 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 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 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 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 bc69f1a794 Clamp brush sizes after context loss
just in case
2019-10-23 16:42:38 -04:00
Isaiah Odhner 3ae98432c5 Restore brush after context loss 2019-10-23 16:42:38 -04:00
Isaiah Odhner dbb9cb5d32 Handle WebGL context loss 2019-10-21 23:43:16 -04:00
Isaiah Odhner ce2c5ab45e Fix shape stroke offset (for line width > 1)
Broken in c871f14b6d (found with git bisect)
2019-10-10 20:28:25 -04:00
Isaiah Odhner 62f3d18438 WIP towards fixing performance with helper layer
Fun accidental behavior: draw weird bit patterns by zooming in and out with the grid.
2019-09-30 20:34:02 -04:00
Isaiah Odhner 40d85e5bb3 Hairline eraser preview border 2019-09-30 19:50:48 -04:00
Isaiah Odhner 27171c24ce WIP eraser preview 2019-09-30 19:50:48 -04:00
Isaiah Odhner 26084174ea Refactor 2019-09-30 19:50:48 -04:00
Isaiah Odhner b8fc07bae1 Fix grid for non-integer devicePixelRatio 2019-09-30 19:50:48 -04:00
Isaiah Odhner b8c60a1ebb WIP Grid
Currently always shown for scales where it's available.

TODO: View > Zoom > Show Grid menu item and Ctrl+G keyboard shortcut, and fix hiDPI scaling with non-integer devicePixelRatio
2019-09-30 19:50:48 -04:00
Isaiah Odhner a70cec382b Fix fill bucket tool 2019-09-24 16:09:13 -04:00
Isaiah Odhner c871f14b6d Fix remaining lint errors
- Deal with "no-redeclare" properly, by using `let`
- I still have eslint ignoring global variable stuff.
2019-09-21 11:59:30 -04:00
Isaiah Odhner 2babccdb49 Fix more lint errors 2019-09-21 11:33:01 -04:00
Isaiah Odhner cb4376c68c Fix lint errors and more Extras menu logic 2019-09-21 11:24:22 -04:00
Isaiah Odhner 604de6aceb Fix brush and pencil drawing offsets
Resolves #124
2018-07-27 14:04:40 -04:00
Isaiah Odhner db7cb4350c Refactor: support x/y radii for rounded rects 2018-06-29 01:01:55 -04:00
Isaiah Odhner 5b5c651f86 Update stroke size immediately on numpad +/- 2018-06-28 23:46:07 -04:00
Isaiah Odhner 275785a5fb Simplify 2018-06-28 23:23:57 -04:00
Isaiah Odhner 7aa6623cdb Clean up 2018-06-28 21:00:51 -04:00
Isaiah Odhner c0cf1b2788 Implement line width for ellipses
- Simplify and improve brush size handling
2018-06-28 20:18:47 -04:00
Isaiah Odhner d89b66efcb Implement line width for rounded rectangles 2018-06-28 19:14:32 -04:00
Isaiah Odhner 029a556ab5 For rectangle tool, draw stroke inside bounds 2018-06-28 14:46:25 -04:00
Isaiah Odhner 5bbc22d0fa Fix separate implementations both enabled 2018-06-27 18:03:02 -04:00