Browse Source

Merge pull request #8 in PG/plugin-bi-screen-adaptive from ~FAY/plugin-bi-screen-adaptive:release/10.0 to release/10.0

* commit '83631205e7378dfea1cd3bed135b87e1ac45012b':
  fix: 优化inBounds
feature/10.0
fay 5 years ago
parent
commit
8962d3ee8a
  1. 4
      src/main/resources/com/finebi/plugin/web/plugin.screen_adaptive.js
  2. 4
      src/main/resources/com/finebi/plugin/web/scripts/entry.js

4
src/main/resources/com/finebi/plugin/web/plugin.screen_adaptive.js

@ -131,8 +131,8 @@
var offset2Body = this.get(0).getBoundingClientRect ? this.get(0).getBoundingClientRect() : this.offset(); var offset2Body = this.get(0).getBoundingClientRect ? this.get(0).getBoundingClientRect() : this.offset();
var width = offset2Body.width || this.outerWidth(); var width = offset2Body.width || this.outerWidth();
var height = offset2Body.height || this.outerHeight(); var height = offset2Body.height || this.outerHeight();
var pageX = e.pageX * scale, var pageX = e.clientX * scale,
pageY = e.pageY * scale + transformY; pageY = e.clientY * scale + transformY;
return !(pageX < Math.floor(offset2Body.left) || pageX > offset2Body.left + width return !(pageX < Math.floor(offset2Body.left) || pageX > offset2Body.left + width
|| pageY < Math.floor(offset2Body.top) || pageY > offset2Body.top + height); || pageY < Math.floor(offset2Body.top) || pageY > offset2Body.top + height);
}; };

4
src/main/resources/com/finebi/plugin/web/scripts/entry.js

@ -131,8 +131,8 @@
var offset2Body = this.get(0).getBoundingClientRect ? this.get(0).getBoundingClientRect() : this.offset(); var offset2Body = this.get(0).getBoundingClientRect ? this.get(0).getBoundingClientRect() : this.offset();
var width = offset2Body.width || this.outerWidth(); var width = offset2Body.width || this.outerWidth();
var height = offset2Body.height || this.outerHeight(); var height = offset2Body.height || this.outerHeight();
var pageX = e.pageX * scale, var pageX = e.clientX * scale,
pageY = e.pageY * scale + transformY; pageY = e.clientY * scale + transformY;
return !(pageX < Math.floor(offset2Body.left) || pageX > offset2Body.left + width return !(pageX < Math.floor(offset2Body.left) || pageX > offset2Body.left + width
|| pageY < Math.floor(offset2Body.top) || pageY > offset2Body.top + height); || pageY < Math.floor(offset2Body.top) || pageY > offset2Body.top + height);
}; };

Loading…
Cancel
Save