Skip to content

Commit

Permalink
Release commit created with Cranko.
Browse files Browse the repository at this point in the history
+++ cranko-release-info-v1
[[projects]]
qnames = ["@wwtelescope/research-app-messages", "npm"]
version = "0.17.3"
age = 0

[[projects]]
qnames = ["@wwtelescope/engine-types", "npm"]
version = "0.6.7"
age = 1

[[projects]]
qnames = ["@wwtelescope/engine", "npm"]
version = "7.29.3"
age = 0

[[projects]]
qnames = ["@wwtelescope/embed-common", "npm"]
version = "0.3.5"
age = 2

[[projects]]
qnames = ["@wwtelescope/embed-creator", "npm"]
version = "0.5.0"
age = 2

[[projects]]
qnames = ["@wwtelescope/astro", "npm"]
version = "0.2.5"
age = 1

[[projects]]
qnames = ["@wwtelescope/engine-helpers", "npm"]
version = "0.16.0"
age = 2

[[projects]]
qnames = ["@wwtelescope/engine-pinia", "npm"]
version = "0.9.0"
age = 2

[[projects]]
qnames = ["@wwtelescope/research-app", "npm"]
version = "0.16.0"
age = 2

[[projects]]
qnames = ["@wwtelescope/embed", "npm"]
version = "1.7.0"
age = 2

+++
  • Loading branch information
cranko committed Nov 10, 2023
2 parents 94b5cc8 + 1b2a748 commit bfee2c5
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 8 deletions.
9 changes: 9 additions & 0 deletions engine/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# @wwtelescope/engine 7.29.3 (2023-11-10)

- Improve handling of touch gestures: don't be so eager to rotate, and
avoid panning as the user lifts up their fingers (#283, @Carifio24)
- Build the UMD module with a `globalObject` of `this` rather than `self` (#282,
@pkgw). This should make the distributed files work in a wider variety of
contexts, including the Constellations dev builds.


# @wwtelescope/engine 7.29.2 (2023-11-03)

- Correct world <-> screen coordinate transformations for when the camera roll
Expand Down
25 changes: 19 additions & 6 deletions engine/esm/wwt_control.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ export function WWTControl() {
this._pointerIds = new Array(2);
this._pinchingZoomRect = new Array(2);
this._moved = false;
this._zooming = false;
this._rotating = false;
this._dragThreshold = 4;

this._foregroundCanvas = null;
this._fgDevice = null;
Expand Down Expand Up @@ -1154,13 +1157,15 @@ var WWTControl$ = {

onTouchMove: function (e) {
var ev = e;

if (this._hasTwoTouches) {
var t0 = ev.touches[0];
var t1 = ev.touches[1];
var newRect = new Array(2);
newRect[0] = Vector2d.create(t0.pageX, t0.pageY);
newRect[1] = Vector2d.create(t1.pageX, t1.pageY);
if (this._pinchingZoomRect[0] != null && this._pinchingZoomRect[1] != null) {

if (!this._dragging && this._pinchingZoomRect[0] != null && this._pinchingZoomRect[1] != null) {
var centerPoint = Vector2d.create(this.renderContext.width / 2, this.renderContext.height / 2);
var delta1 = Vector2d.subtract(newRect[0], this._pinchingZoomRect[0]);
var delta2 = Vector2d.subtract(newRect[1], this._pinchingZoomRect[1]);
Expand All @@ -1176,13 +1181,14 @@ var WWTControl$ = {
var angularComponent2 = Vector2d.subtract(delta2, radialComponent2);
var radialMagnitude = radialComponent1.get_length() + radialComponent2.get_length();
var angularMagnitude = angularComponent1.get_length() + angularComponent2.get_length();
if (radialMagnitude >= angularMagnitude) {

if (radialMagnitude >= 0.5 * angularMagnitude && !this._rotating) {
var oldDist = this.getDistance(this._pinchingZoomRect[0], this._pinchingZoomRect[1]);
var newDist = this.getDistance(newRect[0], newRect[1]);
var ratio = oldDist / newDist;
this.zoom(ratio);
}
else {
this._zooming = true;
} else if (!this._zooming) {
var oldCenterDelta1 = Vector2d.subtract(this._pinchingZoomRect[0], centerPoint);
var oldCenterDelta2 = Vector2d.subtract(this._pinchingZoomRect[1], centerPoint);
var newCenterDelta1 = Vector2d.subtract(newRect[0], centerPoint);
Expand All @@ -1191,26 +1197,31 @@ var WWTControl$ = {
var cross2 = this.crossProductZ(oldCenterDelta2, newCenterDelta2);
var angle1 = Math.asin(cross1 / (oldCenterDelta1.get_length() * newCenterDelta1.get_length()));
var angle2 = Math.asin(cross2 / (oldCenterDelta2.get_length() * newCenterDelta2.get_length()));

if (angle1 * angle2 >= 0) {
var angle = angle1 + angle2;
if (this.get_planetLike() || this.get_solarSystemMode()) {
angle *= -1;
}
this.roll(angle);
this._rotating = true;
}
}
}

this._pinchingZoomRect = newRect;
ev.stopPropagation();
ev.preventDefault();
return;
}

ev.preventDefault();
ev.stopPropagation();
if (this._mouseDown) {
this._dragging = true;

if (this._mouseDown && !(this._rotating || this._zooming)) {
var curX = ev.targetTouches[0].pageX - this._lastX;
var curY = ev.targetTouches[0].pageY - this._lastY;
this._dragging = this._dragging || (Math.sqrt(curX * curX + curY * curY) > this._dragThreshold);
this.move(curX, curY);
this._lastX = ev.targetTouches[0].pageX;
this._lastY = ev.targetTouches[0].pageY;
Expand Down Expand Up @@ -1248,6 +1259,8 @@ var WWTControl$ = {
}
this._mouseDown = false;
this._dragging = false;
this._zooming = false;
this._rotating = false;
},

// Pointer events
Expand Down
2 changes: 1 addition & 1 deletion engine/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,5 @@
"tscheck": "tsc"
},
"types": "./src/index.d.ts",
"version": "7.29.2"
"version": "7.29.3"
}
1 change: 1 addition & 0 deletions engine/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ var config = {
entry: "./esm/index.js",
output: {
path: path.resolve(__dirname, "src"),
globalObject: "this",
library: {
name: "wwtlib",
type: "umd"
Expand Down
6 changes: 6 additions & 0 deletions research-app-messages/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# @wwtelescope/research-app-messages 0.17.3 (2023-11-10)

- Update to the latest typedoc, and other improvements to the documentation
infrastructure (#274, #275, #276, #277, #278, @pkgw).


# @wwtelescope/research-app-messages 0.17.2 (2023-09-15)

- Update sponsorship branding and "front door" email address (#269, #271, @pkgw).
Expand Down
2 changes: 1 addition & 1 deletion research-app-messages/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@
},
"type": "module",
"types": "./dist/src/index.d.ts",
"version": "0.17.2"
"version": "0.17.3"
}

0 comments on commit bfee2c5

Please sign in to comment.