Remove jquery from FrameRenderer.js

This commit is contained in:
Julian Descottes 2018-04-08 13:22:41 +02:00
parent 027cd2e2a6
commit f69e502639
2 changed files with 12 additions and 11 deletions

View File

@ -29,10 +29,11 @@
'yOffset' : 0
};
this.overlayRenderer = new pskl.rendering.frame.CachedFrameRenderer(this.container, cfg, ['canvas-overlay']);
this.renderer = new pskl.rendering.frame.CachedFrameRenderer(this.container, cfg, ['drawing-canvas']);
this.onionSkinRenderer = pskl.rendering.OnionSkinRenderer.createInContainer(this.container, cfg, piskelController);
this.layersRenderer = new pskl.rendering.layer.LayersRenderer(this.container, cfg, piskelController);
var containerEl = this.container.get(0);
this.overlayRenderer = new pskl.rendering.frame.CachedFrameRenderer(containerEl, cfg, ['canvas-overlay']);
this.renderer = new pskl.rendering.frame.CachedFrameRenderer(containerEl, cfg, ['drawing-canvas']);
this.onionSkinRenderer = pskl.rendering.OnionSkinRenderer.createInContainer(containerEl, cfg, piskelController);
this.layersRenderer = new pskl.rendering.layer.LayersRenderer(containerEl, cfg, piskelController);
this.compositeRenderer = new pskl.rendering.CompositeRenderer();
this.compositeRenderer

View File

@ -199,7 +199,7 @@
this.displayCanvas = pskl.utils.CanvasUtils.createCanvas(width, height, this.classList);
pskl.utils.CanvasUtils.disableImageSmoothing(this.displayCanvas);
this.container.append(this.displayCanvas);
this.container.appendChild(this.displayCanvas);
};
ns.FrameRenderer.prototype.onUserSettingsChange_ = function (evt, settingName, settingValue) {
@ -230,9 +230,9 @@
* @public
*/
ns.FrameRenderer.prototype.getCoordinates = function(x, y) {
var containerOffset = this.container.offset();
x = x - containerOffset.left;
y = y - containerOffset.top;
var containerRect = this.container.getBoundingClientRect();
x = x - containerRect.left;
y = y - containerRect.top;
// apply margins
x = x - this.margin.x;
@ -261,9 +261,9 @@
x = x + this.margin.x;
y = y + this.margin.y;
var containerOffset = this.container.offset();
x = x + containerOffset.left;
y = y + containerOffset.top;
var containerRect = this.container.getBoundingClientRect();
x = x + containerRect.left;
y = y + containerRect.top;
return {
x : x + (cellSize / 2),