fix drop from two touches to one

This commit is contained in:
Connor Turland 2017-03-02 04:35:13 +00:00
parent ba943b20f1
commit ddbaac513f
2 changed files with 25 additions and 4 deletions

View file

@ -0,0 +1,18 @@
# frozen_string_literal: true
class ActivityService
def self.send_activity_for_followers(map, reason_filter = nil)
follows = FollowService.get_follows_for_entity(map, nil, reason_filter)
# generate the full set of activity here
follows.each{|follow|
# check here whether this person needs to receive anything
# related to the activity that occurred on the map
body = NotificationService.renderer.render(template: 'template', locals: {}, layout: false)
follow.user.notify('subject', body, event, false, MAP_ACTIVITY, follow.user.emails_allowed, ??)
}
end
end

View file

@ -2692,28 +2692,31 @@ Extras.Classes.Navigation = new Class({
y: (e.touches[0].clientY + e.touches[1].clientY) / 2 y: (e.touches[0].clientY + e.touches[1].clientY) / 2
} }
if (30 >= desiredScale && desiredScale >= 0.2) { if (30 >= desiredScale && desiredScale >= 0.2) {
//canvas.scale(scaler, scaler)
Metamaps.Util.zoomOnPoint(this, scaler, midpoint) Metamaps.Util.zoomOnPoint(this, scaler, midpoint)
jQuery(document).trigger(Metamaps.JIT.events.zoom)
} }
jQuery(document).trigger(Metamaps.JIT.events.zoom);
} }
}, },
onTouchEnd: function(e, win, eventInfo, isRightClick) { onTouchEnd: function(e, win, eventInfo, isRightClick) {
if(!this.config.panning) return; if(!this.config.panning) return;
this.pressed = false;
if (e.touches.length === 1) { if (e.touches.length === 1) {
var canvas = this.canvas, var canvas = this.canvas,
ox = canvas.translateOffsetX, ox = canvas.translateOffsetX,
oy = canvas.translateOffsetY, oy = canvas.translateOffsetY,
sx = canvas.scaleOffsetX, sx = canvas.scaleOffsetX,
sy = canvas.scaleOffsetY sy = canvas.scaleOffsetY,
s = canvas.getSize(); s = canvas.getSize();
this.pos = { this.pos = {
x: (e.touches[0].clientX - s.width/2 - ox) * 1/sx, x: (e.touches[0].clientX - s.width/2 - ox) * 1/sx,
y: (e.touches[0].clientY - s.height/2 - oy) * 1/sy y: (e.touches[0].clientY - s.height/2 - oy) * 1/sy
}; };
this.pos.x *= sx;
this.pos.x += ox;
this.pos.y *= sy;
this.pos.y += oy;
} else if (e.touches.length === 0) { } else if (e.touches.length === 0) {
this.pressed = false;
this.pos = null this.pos = null
if (Metamaps.Mouse.didPan) Metamaps.JIT.SmoothPanning(); if (Metamaps.Mouse.didPan) Metamaps.JIT.SmoothPanning();
} }