mirror of
https://github.com/piskelapp/piskel.git
synced 2023-08-10 21:12:52 +03:00
feature : zoom-level
- Fixed bug with layer rendering when moving drawing offset (bad redraw-flag checking)
This commit is contained in:
parent
cd4952cc7b
commit
44722ab88e
@ -6,8 +6,9 @@
|
|||||||
|
|
||||||
this.piskelController = piskelController;
|
this.piskelController = piskelController;
|
||||||
|
|
||||||
this.belowRenderer = new pskl.rendering.frame.CachedFrameRenderer(container, renderingOptions, ["layers-canvas", "layers-below-canvas"]);
|
// Do not use CachedFrameRenderers here, since the caching will be performed in the render method of LayersRenderer
|
||||||
this.aboveRenderer = new pskl.rendering.frame.CachedFrameRenderer(container, renderingOptions, ["layers-canvas", "layers-above-canvas"]);
|
this.belowRenderer = new pskl.rendering.frame.FrameRenderer(container, renderingOptions, ["layers-canvas", "layers-below-canvas"]);
|
||||||
|
this.aboveRenderer = new pskl.rendering.frame.FrameRenderer(container, renderingOptions, ["layers-canvas", "layers-above-canvas"]);
|
||||||
|
|
||||||
this.add(this.belowRenderer);
|
this.add(this.belowRenderer);
|
||||||
this.add(this.aboveRenderer);
|
this.add(this.aboveRenderer);
|
||||||
@ -18,18 +19,26 @@
|
|||||||
pskl.utils.inherit(pskl.rendering.layer.LayersRenderer, pskl.rendering.CompositeRenderer);
|
pskl.utils.inherit(pskl.rendering.layer.LayersRenderer, pskl.rendering.CompositeRenderer);
|
||||||
|
|
||||||
ns.LayersRenderer.prototype.render = function () {
|
ns.LayersRenderer.prototype.render = function () {
|
||||||
|
var offset = this.getOffset();
|
||||||
|
var size = this.getDisplaySize();
|
||||||
var layers = this.piskelController.getLayers();
|
var layers = this.piskelController.getLayers();
|
||||||
var currentFrameIndex = this.piskelController.currentFrameIndex;
|
var currentFrameIndex = this.piskelController.currentFrameIndex;
|
||||||
var currentLayerIndex = this.piskelController.currentLayerIndex;
|
var currentLayerIndex = this.piskelController.currentLayerIndex;
|
||||||
|
|
||||||
var serializedRendering = [
|
var serializedRendering = [
|
||||||
this.getZoom(),
|
this.getZoom(),
|
||||||
|
offset.x,
|
||||||
|
offset.y,
|
||||||
|
size.width,
|
||||||
|
size.height,
|
||||||
currentFrameIndex,
|
currentFrameIndex,
|
||||||
currentLayerIndex,
|
currentLayerIndex,
|
||||||
layers.length
|
layers.length
|
||||||
].join("-");
|
].join("-");
|
||||||
|
|
||||||
|
|
||||||
if (this.serializedRendering != serializedRendering) {
|
if (this.serializedRendering != serializedRendering) {
|
||||||
|
console.log(serializedRendering);
|
||||||
this.serializedRendering = serializedRendering;
|
this.serializedRendering = serializedRendering;
|
||||||
|
|
||||||
this.clear();
|
this.clear();
|
||||||
|
Loading…
Reference in New Issue
Block a user