(viewer)
| 8 | const svgNS = 'http://www.w3.org/2000/svg'; |
| 9 | |
| 10 | const update = function(viewer) { |
| 11 | const info = viewer._svgOverlayInfo; |
| 12 | |
| 13 | if (info.containerWidth !== viewer.container.clientWidth) { |
| 14 | info.containerWidth = viewer.container.clientWidth; |
| 15 | info.svg.setAttribute('width', info.containerWidth); |
| 16 | } |
| 17 | |
| 18 | if (info.containerHeight !== viewer.container.clientHeight) { |
| 19 | info.containerHeight = viewer.container.clientHeight; |
| 20 | info.svg.setAttribute('height', info.containerHeight); |
| 21 | } |
| 22 | |
| 23 | const p = viewer.viewport.pixelFromPoint(new OpenSeadragon.Point(0, 0), true); |
| 24 | const zoom = viewer.viewport.getZoom(true); |
| 25 | const scale = viewer.container.clientWidth * zoom; |
| 26 | info.node.setAttribute('transform', |
| 27 | 'translate(' + p.x + ',' + p.y + ') scale(' + scale + ')'); |
| 28 | }; |
| 29 | |
| 30 | OpenSeadragon.Viewer.prototype.svgOverlay = function(command) { |
| 31 | const self = this; |
no outgoing calls
no test coverage detected
searching dependent graphs…