Commit Graph

730 Commits (6ac691e9bdcc08bf4ffdc15cd03204c95ae706f5)

Author SHA1 Message Date
Isaiah Odhner 6ac691e9bd Avoid antialiasing in more scenarios
Enable aliasing (nearest neighbor scaling) for more scenarios. This improves quality at some scales of the canvas and device pixel ratios, by re-enabling aliasing. In particular this avoids a browser bug in chrome where the canvas will jump back and forth between being antialiased and aliased, but only for these certain scenarios. Any time it's antialiased, it can also exhibit this bug in chrome.
2019-09-30 19:50:48 -04:00
Isaiah Odhner 7f9b7fb096 Update grid when zooming 2019-09-30 19:50:48 -04:00
Isaiah Odhner 101f2f6201 Toggle grid with menu item or Ctrl+G 2019-09-30 19:50:48 -04:00
Isaiah Odhner f65e67c491 Don't suggest Ctrl+W which closes browser tab 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 f1abaa7304 Make parameter for hiding the main canvas handles 2019-09-30 19:50:48 -04:00
Isaiah Odhner 87e15d3cf2 Fix horrible lag with multitools
For each tool for each tool -> for each tool. I didn't think about it very much when I was adding this silly feature.
2019-09-30 19:50:48 -04:00
Isaiah Odhner 3e777cb5b7 Add safety measures 2019-09-30 19:50:48 -04:00
Isaiah Odhner 0421882eaf Save undos/redos as ImageData & fix Free-Form Select
- (PARTIALLY avoid a browser bug in chrome. When you zoom to a non-integer scale, there's this weird quantum antialiasing due to the canvas having a backing store which is higher density than the canvas's logical pixels (and redraw regions come into play as well). Switching to storing ImageData instead of canvases for undos/redos doesn't eliminate much of this problem, but it avoids having the undos/redos also store some high-DPI state and thereby SOMETIMES restore a state of whether antialiasing is happening or not. So it's a little less weird now, but it doesn't really solve that bugginess.)
- Protect against data loss when running low on memory. The browser (chrome at least) can clear canvases when low on memory. If the data is erased, and you undo, or do anything to the canvas, jspaint saves over the autosave. Ideally there should be multiple autosaves, but for now this is catastrophic in terms of data loss. Using ImageData instead of canvases, hopefully the browser is less willing to destroy this data, since it's more like a plain data structure in your program, and you would hope it wouldn't just delete arbitrary data in your program. A crash should be better than losing the canvas data (undos/redos) because in that case the autosave should still be in tact, altho this doesn't protect against the case where the main canvas is cleared by the browser, and then you do something to interact with the canvas other than undo/redo, and then either the page crashes or you refresh, and the autosave will still be gone.
- Behavior change or Regression: Now if the document is transparent, but the document mode is opaque, and you paste something larger than the canvas, it'll keep the transparency in the area of the original document, because it's using putImageData instead of drawImage.
- Regression: When you choose Opaque in the Image > Attributes... it no longer makes the document opaque because it's using putImageData instead of drawImage.
- Fix: Rewrite the Free-Form Select's temporary shape preview to use a proper layer instead of abusing the undo stack. This reduces the number of undo states created, and should make it easier to implement passive selections in the future. (Selections shouldn't create an undo state until you start dragging them.) This should also fix a bug in multiplayer where "inverty brush" could be left behind.
2019-09-30 19:50:48 -04:00
Isaiah Odhner 2a5206a2c5 Enable antialiasing at awkward pixel sizes
Compromise for https://github.com/1j01/jspaint/issues/103

Note that this uncovers weird buggy browser behavior where canvas HiDPI state is remembered per undo state, and can fluctuate based on mouse presses (often makes it go antialiased) and undoing (often makes it go aliased), and it can even go partially antialiased, in redraw regions as you paint.

Also it definitely needs additional handling for the canvas itself, which can have a magnification factor.
2019-09-29 22:04:20 -04:00
Isaiah Odhner 2079717ea2 Tweak 36x36 icon in Paint.NET
which is a way better editor
2019-09-29 14:53:31 -04:00
Isaiah Odhner d4872d85a3 Pixel 36x36 icon a bit in jspaint based on 32x32 2019-09-29 14:42:13 -04:00
Isaiah Odhner dac402b64b Clean up icon files
Use a (more) consistent naming scheme
2019-09-29 14:36:45 -04:00
Isaiah Odhner 5a2bc6287e Tweak safari pinned tab icon based on 16px bitmap icon 2019-09-29 14:29:29 -04:00
Isaiah Odhner 0f8d1c6c4e Make safari pinned tab icon 16px 2019-09-29 14:10:57 -04:00
Isaiah Odhner bc1afbab52 Add Safari pinned tab icon 2019-09-29 13:22:04 -04:00
Isaiah Odhner 278ee910c3 Comment quick undo code and rename var 2019-09-28 23:37:14 -04:00
Yanrishatum 435271d5d2 Fix quick undo for mouse
Resolves #9
2019-09-28 23:33:48 -04:00
Isaiah Odhner 701058ede0 Upgrade to jQuery 3.4.1 with CDN & fallback 2019-09-28 13:48:44 -04:00
Isaiah Odhner 1ec5a60b86 Tweak splash screen 2019-09-28 11:45:47 -04:00
Isaiah Odhner 87c93e1200 Maybe keep using the favicon.ico 2019-09-27 22:33:10 -04:00
Isaiah Odhner d5c9b8219e Fix favicon size selection in chrome 2019-09-27 22:10:18 -04:00
Isaiah Odhner aa8475030c Remove deprecated "density" and include small icons 2019-09-27 22:01:52 -04:00
Isaiah Odhner f70a7c0548 Make JS Paint installable
- Use new vector icon
- Use https://www.favicon-generator.org to create a template for what icons are needed etc.
- Tweak paths and add and update metadata
2019-09-27 19:22:10 -04:00
Isaiah Odhner 0e2bb14091 Create vector icon 2019-09-25 16:19:40 -04:00
Isaiah Odhner a70cec382b Fix fill bucket tool 2019-09-24 16:09:13 -04:00
Isaiah Odhner ae555b9a41 Fix scrollbars after Konami Code finishes 2019-09-21 20:45:12 -04:00
Isaiah Odhner 2b9486c9af Stop trying to disable font smoothing
https://github.com/1j01/jspaint/issues/130
2019-09-21 13:42:14 -04:00
Isaiah Odhner e0d30bf34f npm audit fix 2019-09-21 13:07:56 -04:00
Isaiah Odhner e375d7190d Update other deps 2019-09-21 12:54:01 -04:00
Isaiah Odhner 00e25455d0 Clean up 2019-09-21 12:37:12 -04:00
Isaiah Odhner 71887dff92 Update Electron + Electron Forge and fix clipboard support
Fix clipboard support by updating Electron to a version that supports the Async Clipboard API with images, and remove the old code that was specifically for electron!
2019-09-21 12:37:12 -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 0fdcbc554a Fix Extras menu visibility logic 2019-09-21 10:57:29 -04:00
Isaiah Odhner d9064f70c7 Work on text copy/paste, but the menus don't allow it 2019-09-21 10:43:20 -04:00
Isaiah Odhner 23fee3df4d Make tool transparent mode a bool 2019-09-21 10:01:26 -04:00
Isaiah Odhner 9c1bfdb831 Improve error message when local storage unavailable 2019-09-21 09:31:16 -04:00
Isaiah Odhner 0fc2170bb5 Handle local storage unavailable in storage manager 2019-09-21 09:24:47 -04:00
Isaiah Odhner f7c0d431c5 Refactor transparency detection 2019-09-21 02:04:59 -04:00
Isaiah Odhner 69146d7279 Return to multiple tools 2019-09-21 01:59:56 -04:00
Isaiah Odhner d986c5ad99 Fix selecting previous tool after eyedropper or magnifier 2019-09-21 01:50:02 -04:00
Isaiah Odhner a5acf95387 Fix error message 2019-09-21 00:38:34 -04:00
Isaiah Odhner c0938c89de Improve Firebase quota message 2019-09-20 14:12:27 -04:00
Isaiah Odhner fee30a9df6 Fix Firebase event cleanup
- Simplify with destructuring
- Don't pass error_callback
2019-09-20 14:02:01 -04:00
Isaiah Odhner 874e50fc3e Go thru eslint problems
- And pull maximal stuff out of most try-catches (with empty catches)
- Simplify Firebase event cleanup by structuring data
2019-09-20 13:15:21 -04:00
Isaiah Odhner 5a4abc4591 Rename textbox object OnCanvasTextBox 2019-09-20 12:34:14 -04:00