make mouse coords zero indexed.
This commit is contained in:
parent
2105eb3d5b
commit
965af859b0
|
@ -275,6 +275,8 @@ Program.prototype._bindMouse = function(s) {
|
|||
if (key.x === -32) key.x = 255;
|
||||
if (key.y === -32) key.y = 255;
|
||||
|
||||
if (this.zero) key.x--, key.y--;
|
||||
|
||||
mod = b >> 3;
|
||||
key.shift = mod & 4;
|
||||
key.meta = mod & 8;
|
||||
|
@ -333,6 +335,8 @@ Program.prototype._bindMouse = function(s) {
|
|||
key.x = x;
|
||||
key.y = y;
|
||||
|
||||
if (this.zero) key.x--, key.y--;
|
||||
|
||||
// NOTE: Duplicate of the above.
|
||||
mod = b >> 3;
|
||||
key.shift = mod & 4;
|
||||
|
@ -393,6 +397,8 @@ Program.prototype._bindMouse = function(s) {
|
|||
key.x = x;
|
||||
key.y = y;
|
||||
|
||||
if (this.zero) key.x--, key.y--;
|
||||
|
||||
b &= 3;
|
||||
|
||||
// NOTE: Get mod. And wheel.
|
||||
|
@ -428,6 +434,8 @@ Program.prototype._bindMouse = function(s) {
|
|||
key.x = x;
|
||||
key.y = y;
|
||||
|
||||
if (this.zero) key.x--, key.y--;
|
||||
|
||||
key.action = b === 3
|
||||
? 'mouseup'
|
||||
: 'mousedown';
|
||||
|
@ -456,6 +464,8 @@ Program.prototype._bindMouse = function(s) {
|
|||
key.x = x;
|
||||
key.y = y;
|
||||
|
||||
if (this.zero) key.x--, key.y--;
|
||||
|
||||
key.action = 'mousedown';
|
||||
key.button =
|
||||
b === 1 ? 'left'
|
||||
|
|
|
@ -1053,6 +1053,7 @@ Screen.prototype.setEffects = function(el, fel, over, out, effects, temp) {
|
|||
if (typeof val === 'string') {
|
||||
effects[key] = val;
|
||||
} else if (val && typeof val === 'object' && !Array.isArray(val)) {
|
||||
// TODO: Remove this now that colors are handled lazily.
|
||||
Object.keys(effects[key]).forEach(function(k) {
|
||||
var v = effects[key][k];
|
||||
effects[key][k] = v;
|
||||
|
|
Loading…
Reference in New Issue