New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@driftory/viewer

Package Overview
Dependencies
Maintainers
2
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@driftory/viewer - npm Package Compare versions

Comparing version 0.2.0 to 0.2.1

1

dist/driftory.d.ts

@@ -42,2 +42,3 @@ /// <reference types="openseadragon" />

frameIndex: number;
frameIndexHint: number;
lastScrollTime: number;

@@ -44,0 +45,0 @@ scrollDelay: number;

43

dist/driftory.js

@@ -28,2 +28,3 @@ "use strict";

this.frameIndex = -1;
this.frameIndexHint = -1;
this.lastScrollTime = 0;

@@ -193,16 +194,16 @@ this.scrollDelay = 2000;

var _this = this;
var frameHandler = function () {
var frameIndex = _this._figureFrameIndex(false);
if (frameIndex !== -1 && frameIndex !== _this.frameIndex) {
_this.frameIndex = frameIndex;
_this._updateImageVisibility();
if (_this.onFrameChange) {
_this.onFrameChange({
frameIndex: frameIndex,
isLastFrame: frameIndex === _this.getFrameCount() - 1
});
if (this.viewer) {
var frameHandler = function () {
var frameIndex = _this._figureFrameIndex(false);
if (frameIndex !== -1 && frameIndex !== _this.frameIndex) {
_this.frameIndex = frameIndex;
_this._updateImageVisibility();
if (_this.onFrameChange) {
_this.onFrameChange({
frameIndex: frameIndex,
isLastFrame: frameIndex === _this.getFrameCount() - 1
});
}
}
}
};
if (this.viewer) {
};
this.viewer.addHandler('zoom', frameHandler);

@@ -243,2 +244,3 @@ this.viewer.addHandler('pan', frameHandler);

if (frame) {
this.frameIndexHint = index;
var box = frame.clone();

@@ -267,2 +269,6 @@ box.width *= 1 + bufferFactor;

if (frame.containsPoint(viewportCenter)) {
if (this.frameIndexHint === i) {
bestIndex = i;
break;
}
var distance = viewportCenter.squaredDistanceTo(frame.getCenter());

@@ -280,2 +286,3 @@ if (distance < bestDistance) {

Driftory.prototype._getHitFrame = function (point) {
var bestIndex = -1;
if (this.viewer) {

@@ -285,7 +292,13 @@ for (var i = 0; i < this.frames.length; i++) {

if (frame.containsPoint(point)) {
return i;
if (this.frameIndex === i) {
bestIndex = i;
break;
}
if (bestIndex === -1) {
bestIndex = i;
}
}
}
}
return -1;
return bestIndex;
};

@@ -292,0 +305,0 @@ // ----------

{
"name": "@driftory/viewer",
"version": "0.2.0",
"version": "0.2.1",
"description": "A viewer for comics created with https://www.driftory.com/",

@@ -5,0 +5,0 @@ "main": "./dist/driftory.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc