mirror of
https://github.com/piskelapp/piskel.git
synced 2023-08-10 21:12:52 +03:00
Refactoring. Create function to get current frame
This commit is contained in:
parent
5e364e984c
commit
65f4fd0f27
@ -93,6 +93,11 @@
|
|||||||
left: 1px;
|
left: 1px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.cursor-coordinates .frame-info {
|
||||||
|
line-height: 1.5;
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Canvases layout
|
* Canvases layout
|
||||||
*/
|
*/
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
$.subscribe(Events.DRAG_END, this.onDragEnd_.bind(this));
|
$.subscribe(Events.DRAG_END, this.onDragEnd_.bind(this));
|
||||||
$.subscribe(Events.FRAME_SIZE_CHANGED, this.redraw.bind(this));
|
$.subscribe(Events.FRAME_SIZE_CHANGED, this.redraw.bind(this));
|
||||||
$.subscribe(Events.ZOOM_CHANGED, this.redraw.bind(this));
|
$.subscribe(Events.ZOOM_CHANGED, this.redraw.bind(this));
|
||||||
|
$.subscribe(Events.PISKEL_RESET, this.redraw.bind(this));
|
||||||
|
|
||||||
this.redraw();
|
this.redraw();
|
||||||
};
|
};
|
||||||
@ -45,15 +46,19 @@
|
|||||||
html += '<div class="drawing-zoom">x' + zoom + '</div>';
|
html += '<div class="drawing-zoom">x' + zoom + '</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
this.coordinatesContainer.innerHTML = this.getFrameSizeHTML_() + html;
|
this.coordinatesContainer.innerHTML = this.getFrameSizeHTML_() + html + this.getCurrentFrameIndexHTML_();
|
||||||
|
};
|
||||||
|
|
||||||
|
ns.CursorCoordinatesController.prototype.getCurrentFrameIndexHTML_ = function () {
|
||||||
|
var currentFrameIndex = this.piskelController.getCurrentFrameIndex() + 1;
|
||||||
|
var frameCount = this.piskelController.getFrameCount();
|
||||||
|
return '<div class="frame-info">' + currentFrameIndex + '/' + frameCount + '</div>';
|
||||||
};
|
};
|
||||||
|
|
||||||
ns.CursorCoordinatesController.prototype.getFrameSizeHTML_ = function () {
|
ns.CursorCoordinatesController.prototype.getFrameSizeHTML_ = function () {
|
||||||
var w = this.piskelController.getWidth();
|
var w = this.piskelController.getWidth();
|
||||||
var h = this.piskelController.getHeight();
|
var h = this.piskelController.getHeight();
|
||||||
var currentFrameIndex = this.piskelController.getCurrentFrameIndex() + 1;
|
return '[' + w + 'x' + h + '] ';
|
||||||
var frameCount = this.piskelController.getFrameCount();
|
|
||||||
return '[' + w + 'x' + h + '] ' + currentFrameIndex + '/' + frameCount;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
ns.CursorCoordinatesController.prototype.onCursorMoved_ = function (event, x, y) {
|
ns.CursorCoordinatesController.prototype.onCursorMoved_ = function (event, x, y) {
|
||||||
|
Loading…
Reference in New Issue
Block a user