fix for reduced resource consumption that backfired on fast devices

This commit is contained in:
Gavin McDonald
2019-02-12 23:38:55 +00:00
parent c65a06a4ae
commit d893e6c003
4 changed files with 3799 additions and 20 deletions

View File

@@ -93,6 +93,8 @@ export class Tessellate {
'remap',
].map(method => {this[method] = this[method].bind(this)});
this.interacted = Date.now();
this.checkSettings(settings);
this.sketch = new Sketch({
@@ -152,7 +154,7 @@ export class Tessellate {
const tile = this.cartographer.pixelToTile(point);
const mapTile = this.cartographer.teleport(tile);
this.interacted = true;
this.interacted = Date.now();
this.settings.tap({
event,
@@ -169,6 +171,7 @@ export class Tessellate {
const mapTile = this.cartographer.teleport(tile);
this.interacted = true;
this.interacted = Date.now();
let tap = {
event,
@@ -187,6 +190,7 @@ export class Tessellate {
const mapTile = this.cartographer.teleport(tile);
this.interacted = true;
this.interacted = Date.now();
this.settings.pressStart({
event,
@@ -202,6 +206,7 @@ export class Tessellate {
const mapTile = this.cartographer.teleport(tile);
this.interacted = true;
this.interacted = Date.now();
this.settings.press({
event,
@@ -212,10 +217,12 @@ export class Tessellate {
}
move (event) {
this.interacted = Date.now();
return this.cartographer.move(event);
}
zoom (event) {
this.interacted = Date.now();
this.cartographer.zoom(event);
}
@@ -231,9 +238,9 @@ export class Tessellate {
this.lastLocation = this.lastLocation || {};
const currentLocation = utils.extend({
scale: this.cartographer.getScale(),
originX: this.cartographer.getOriginX(),
originY: this.cartographer.getOriginY(),
scaleOrig: this.cartographer.getScale(),
}, corners);
const changed = funky.reduce(currentLocation, (same, val, key) => same || this.lastLocation[key] !== val, false);
@@ -266,9 +273,6 @@ export class Tessellate {
lowerRightY: height
};
const interacted = this.interacted;
this.interacted = false;
const moved = this.newLocation(corners);
this.locationSets = moved ? this.getLocationSets(corners) : this.locationSets;
@@ -281,8 +285,8 @@ export class Tessellate {
lastNow: context.lastUTC,
now: context.utc,
interacted,
moved,
interacted: this.interacted,
locationSets: this.locationSets,
});
}