Commit Graph

2947 Commits

Author SHA1 Message Date
ronnymikalsen
f0cf90df76 fix: removes resize event on destroy 2021-03-26 09:43:30 +01:00
ronnymikalsen
99f87c0bc7 docs: fixed typo and corrected the comment 2021-03-25 14:54:42 +01:00
ronnymikalsen
7ab493d18b fix: made updatePixelDensityRatio private
Prefixed it with a underscore and added @private annotation
2021-03-25 14:41:11 +01:00
Alistair Buxton
eebfdc1391 Improve the flipping example
Adds tiled images to the viewer at creation so that they are properly
centred.

This also checks the current state of the test checkboxes on loading.
Some browsers, notably Firefox, will remember the value of checkboxes
across reloads. This can lead to the checkboxes being out of sync with
with viewer after a reload.

An alternative is to set autocomplete="off" on each checkbox element.
This will force the browser to reset the field to the default specified
in the HTML. However I think checking the actual value is preferable
as it means the defaults are only specified in one place.
2021-03-23 03:22:13 +00:00
Alistair Buxton
409620fa38 Tidy up the tile/image flip check
Don't need double negation and brackets here.
2021-03-23 02:26:06 +00:00
Alistair Buxton
7552806a47 Force reload tiles when the tile's flip doesn't match the image
Flipping an image changes the bounds of each tile. The existing
code assumes that cannot happen. getTile() calculates the tile
bounds the first time it is asked for a particular tile. It then
caches and returns the same time on every subsequent call.

getTile() has a check to test if a tile exists in the cache. If
it does not, the tile is created and inserted. In order to make
tiles be rebuilt after a flip, we only need to check if the tile's
flip matches the image's flip. If not, we can recreate the tile
as if it did not exist.

To make this a bit clearer, the tile's flipped flag is now set
in getTile() rather than positionTile().

This makes setFlip() work.
2021-03-22 06:45:26 +00:00
Alistair Buxton
3161808a9d Add a basic setFlip method to TiledImage
This doesn't fully work - even raising a bounds-change doesn't seem
to be enough.
2021-03-19 17:16:25 +00:00
Alistair Buxton
53052c8c08 Add flipping example
This isn't complete - the flip toggles do not work as setFlip() is
not implemented. The second image is currently always flipped.
2021-03-19 15:45:21 +00:00
Alistair Buxton
b2b95e8556 Correctly set the rightmost tile property when flipped
This ensures that seams are not visible in Firefox and Safari when
the image is wrapped horizontally and also flipped.
2021-03-19 14:49:07 +00:00
Alistair Buxton
3c57063632 Render the flipped columns in reverse order
This completes the per-image flip implementation. Tile bounds are
re-positioned within the image. When rendering, the x ordinals are
remapped to the flipped ones.

To use, set "flipped" on the image instead of the viewer. The code
is compatible with rotations and wrapping.

Implements #1553
2021-03-19 14:49:07 +00:00
Alistair Buxton
afa8c2d1bd Store the flipped state in each tile and render it as such
This will flip each individual tile on a per image bases. However
the tiles are now drawn in the wrong locations. Clipping etc works.
this is implemented for Canvas and HTML renderers.
2021-03-19 14:49:07 +00:00
Alistair Buxton
4b13cf32fd Introduce getTileBounds method for tiledImage
This wraps the implementation in tileSource but provides support for
wrapping. It does not support getting the source bounds.

Using this function instead of the tileSource version allows the
viewport clipping optimization to work with wrapping.
2021-03-19 14:49:07 +00:00
Ian Gilman
58a90f7c39
Merge pull request #1960 from openseadragon/ms-firefox-test
Fixed test "Events: Viewer: preventDefaultAction in dblClickHandler".…
2021-03-18 11:21:15 -07:00
Ian Gilman
7a9e496c64
Merge branch 'master' into ms-firefox-test 2021-03-18 11:20:51 -07:00
Ian Gilman
34aa187e65
Merge pull request #1958 from openseadragon/ms-referencestrip
ReferenceStrip: Fixed destroy() exception and made element focusable
2021-03-18 11:17:58 -07:00
Mark Salsbery
a0ff35a153 more code cleanup 2021-03-17 16:18:49 -07:00
Mark Salsbery
baeb70fdcc code cleanup 2021-03-17 16:15:22 -07:00
Mark Salsbery
6b846249e4 changelog update 2021-03-17 15:24:18 -07:00
Mark Salsbery
b0447979f3 Fixed test "Events: Viewer: preventDefaultAction in dblClickHandler". Fixes #1372 2021-03-17 15:15:36 -07:00
Mark Salsbery
f73420af9b changelog update 2021-03-17 13:06:41 -07:00
Mark Salsbery
e8accfdfaf ReferenceStrip: Fixed destroy() exception and made element focusable 2021-03-17 13:04:13 -07:00
Ian Gilman
16ab337146
Merge pull request #1957 from openseadragon/ms-preventDefault
Added preventDefault option to MouseTracker handlers: ...
2021-03-17 11:30:17 -07:00
Mark Salsbery
8c29f705e6 changelog update 2021-03-16 19:48:08 -07:00
Mark Salsbery
870d9df779 Code cleanup, better scrollHandler handling in Viewer 2021-03-16 19:47:08 -07:00
Mark Salsbery
23d00c92c1 Added preventDefault option to MouseTracker handlers: scrollHandler, keyDownHandler, keyUpHandler, keyHandler 2021-03-16 19:35:22 -07:00
Ian Gilman
733f851ad3
Merge pull request #1956 from openseadragon/ms-gesturesettings
Added dragToPan to the GestureSettings class
2021-03-16 13:40:26 -07:00
Mark Salsbery
f99c9a8a4f Merge branch 'master' into ms-gesturesettings
* master:
  Added changelog for #1954 and bumped upcoming version to 3.0.0
  Update jsdoc, replace Object.assign with $.extend
  Create setImageFormatsSupported function

# Conflicts:
#	changelog.txt
2021-03-16 12:04:58 -07:00
Ian Gilman
3caf4a0da4 Added changelog for #1954 and bumped upcoming version to 3.0.0 2021-03-16 11:53:13 -07:00
Ian Gilman
dfd4ea3b04
Merge pull request #1954 from pandaxtc/set_formats_supported
Create setImageFormatsSupported function
2021-03-16 11:50:57 -07:00
Mark Salsbery
38a6189c20 code cleanup 2021-03-16 11:37:32 -07:00
Mark Salsbery
033c16ca85 Remember to initialize new properties! Code cleanup... 2021-03-16 11:27:48 -07:00
Mark Salsbery
84c23c3729 changelog update 2021-03-16 10:42:54 -07:00
Mark Salsbery
3947c81726 Added dragToPan to the GestureSettings class, implemented in Viewer 2021-03-16 10:40:36 -07:00
Waylon Peng
1ccefd9f6a Update jsdoc, replace Object.assign with $.extend 2021-03-15 16:20:26 -07:00
Ian Gilman
118f4cfed6
Merge pull request #1857 from openseadragon/dependabot/npm_and_yarn/lodash-4.17.19
Bump lodash from 4.17.15 to 4.17.19
2021-03-15 11:20:25 -07:00
Waylon Peng
54721608a4 Create setImageFormatsSupported function 2021-03-12 23:03:18 -08:00
Ian Gilman
96ce058d13
Merge pull request #1953 from openseadragon/ms-preventDefaultAction
Fixed preventDefaultAction Functionality in Viewer Events
2021-03-12 11:44:33 -08:00
Ian Gilman
84b0aea54b Merge branch 'master' into ms-preventDefaultAction 2021-03-12 11:44:10 -08:00
Ian Gilman
dc753985b3
Merge pull request #1951 from openseadragon/ms-mousetracker
MouseTracker preProcessEvent on keydown, keyup, keypress, focus, blur Events
2021-03-12 11:38:57 -08:00
Ian Gilman
bbdcd0579b Merge branch 'master' into ms-mousetracker 2021-03-12 11:37:36 -08:00
Ian Gilman
d4eaefbae1 Changelog refinement 2021-03-12 11:19:29 -08:00
ronnymikalsen
89d4499c2f Merge branch 'master' into 1763-a11y-browser-zoom 2021-03-12 10:21:42 +01:00
Mark Salsbery
d6cec05dee Removed code formatting changes to reduce noise in PR 2021-03-11 21:04:42 -08:00
Mark Salsbery
aa6cc3f5c2 changelog update 2021-03-11 20:34:24 -08:00
Mark Salsbery
57a98c5ec2 Fixed preventDefaultAction functionality tests, removed unused preventDefaultAction instances from MouseTracker 2021-03-11 20:30:50 -08:00
Mark Salsbery
0195c5a5ec preventDefaultAction - removed from MouseTracker, implemented for canvas-pinch and canvas-scroll events 2021-03-11 16:09:57 -08:00
Mark Salsbery
83788cbb75 key down/up event disposition defaults 2021-03-11 16:07:24 -08:00
Mark Salsbery
bed6cfa853 Removed a bit more IE<11 code 2021-03-10 17:18:17 -08:00
Mark Salsbery
802c3c23f7 Merge branch 'master' into ms-mousetracker
* master:
  Changelog update
  Remove support for IE < 11
2021-03-10 16:17:44 -08:00
Mark Salsbery
145d742760
Merge pull request #1950 from rmontroy/ms-IE
Remove support for IE < 11 (#1863)
2021-03-10 16:15:44 -08:00