Browse Source

Fix autoscroll

pull/1800/head
Artur Arseniev 7 years ago
parent
commit
f6e18f0f6d
  1. 17
      src/canvas/index.js
  2. 3
      src/commands/view/SelectComponent.js

17
src/canvas/index.js

@ -62,13 +62,14 @@ module.exports = () => {
* @param {Object} config Configurations
* @private
*/
init(config) {
c = config || {};
for (var name in defaults) {
if (!(name in c)) c[name] = defaults[name];
}
init(config = {}) {
c = {
...defaults,
...config
};
var ppfx = c.pStylePrefix;
this.em = c.em;
const ppfx = c.pStylePrefix;
if (ppfx) c.stylePrefix = ppfx + c.stylePrefix;
canvas = new Canvas(config);
@ -463,7 +464,7 @@ module.exports = () => {
updateClientY(ev) {
ev.preventDefault();
this.lastClientY = getPointerEvent(ev).clientY;
this.lastClientY = getPointerEvent(ev).clientY * this.em.getZoomDecimal();
},
/**
@ -503,7 +504,7 @@ module.exports = () => {
},
getScrollListeners() {
return [this.getFrameEl().contentWindow, this.getElement()];
return [this.getFrameEl().contentWindow];
},
postRender() {

3
src/commands/view/SelectComponent.js

@ -266,7 +266,6 @@ module.exports = {
* @private
* */
updateBadge(el, pos) {
const { em } = this;
var $el = $(el);
var canvas = this.canvas;
var config = canvas.getConfig();
@ -281,7 +280,7 @@ module.exports = {
var bStyle = badge.style;
var u = 'px';
bStyle.display = 'block';
var canvasPos = canvas.getCanvasView().getPosition();
var canvasPos = this.getCanvasPosition();
if (canvasPos) {
const canvasTop = canvasPos.top;

Loading…
Cancel
Save