Procházet zdrojové kódy

fixes #1381

(cherry picked from commit e971964eef)
tags/v0.4.4^2
Big Bad Waffle před 4 roky
rodič
revize
431da03b3f
2 změnil soubory, kde provedl 8 přidání a 4 odebrání
  1. +2
    -2
      src/client/js/components/spellbook.js
  2. +6
    -2
      src/client/js/input.js

+ 2
- 2
src/client/js/components/spellbook.js Zobrazit soubor

@@ -90,8 +90,8 @@ define([
onMouseDown: function (e, target) {
if (isMobile && this.groundTargetSpell) {
this.groundTarget = {
x: ~~(e.x / scale),
y: ~~(e.y / scale)
x: ~~(e.worldX / scale),
y: ~~(e.worldY / scale)
};

this.onKeyDown(this.groundTargetSpell);


+ 6
- 2
src/client/js/input.js Zobrazit soubor

@@ -197,6 +197,10 @@ define([
this.mouse.down = true;
this.mouse.event = e;

//This is needed for casting targetted spells on Mobile...it's hacky.
this.mouse.worldX = e.pageX + renderer.pos.x;
this.mouse.worldY = e.pageY + renderer.pos.y;

events.emit('mouseDown', this.mouse);
},
mouseUp: function (e) {
@@ -223,8 +227,8 @@ define([
return;

const zoom = window.devicePixelRatio;
this.mouse.x = e.offsetX * zoom + renderer.pos.x;
this.mouse.y = e.offsetY * zoom + renderer.pos.y;
this.mouse.x = (e.offsetX * zoom) + renderer.pos.x;
this.mouse.y = (e.offsetY * zoom) + renderer.pos.y;
}
},



Načítá se…
Zrušit
Uložit