Browse Source

Add `tools` option to `editor.refresh` method

pull/3073/head
Artur Arseniev 6 years ago
parent
commit
3e4fd24481
  1. 1
      src/commands/view/SelectComponent.js
  2. 4
      src/editor/index.js
  3. 3
      src/editor/model/Editor.js

1
src/commands/view/SelectComponent.js

@ -97,6 +97,7 @@ export default {
);
em[method]('change:canvasOffset', this.updateAttached, this);
em[method]('frame:updated', this.onFrameUpdated, this);
em[method]('canvas:updateTools', this.onFrameUpdated, this);
em.get('Canvas')
.getFrames()
.forEach(frame => {

4
src/editor/index.js

@ -490,8 +490,8 @@ export default (config = {}) => {
*
* @private
*/
refresh() {
em.refreshCanvas();
refresh(opts) {
em.refreshCanvas(opts);
},
/**

3
src/editor/model/Editor.js

@ -614,9 +614,10 @@ export default Backbone.Model.extend({
* Update canvas dimensions and refresh data useful for tools positioning
* @private
*/
refreshCanvas() {
refreshCanvas(opts = {}) {
this.set('canvasOffset', null);
this.set('canvasOffset', this.get('Canvas').getOffset());
opts.tools && this.trigger('canvas:updateTools');
},
/**

Loading…
Cancel
Save