fix right-shift restore over size changes
This commit is contained in:
parent
f0efda1d5f
commit
708905d28d
|
@ -96,13 +96,13 @@ class ChunkLoader {
|
||||||
y: number,
|
y: number,
|
||||||
historicalDate: string,
|
historicalDate: string,
|
||||||
historicalTime: string,
|
historicalTime: string,
|
||||||
|
historicalCanvasSize: number,
|
||||||
) {
|
) {
|
||||||
const { canvasSize } = this;
|
|
||||||
if (!historicalDate) {
|
if (!historicalDate) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
const [cx, cy] = getChunkOfPixel(canvasSize, x, y);
|
const [cx, cy] = getChunkOfPixel(historicalCanvasSize, x, y);
|
||||||
const px = getCellInsideChunk(canvasSize, [x, y]);
|
const px = getCellInsideChunk(historicalCanvasSize, [x, y]);
|
||||||
const curTime = Date.now();
|
const curTime = Date.now();
|
||||||
|
|
||||||
if (!historicalTime || historicalTime !== '0000') {
|
if (!historicalTime || historicalTime !== '0000') {
|
||||||
|
|
|
@ -164,9 +164,10 @@ class Renderer {
|
||||||
const {
|
const {
|
||||||
historicalDate,
|
historicalDate,
|
||||||
historicalTime,
|
historicalTime,
|
||||||
|
historicalCanvasSize,
|
||||||
} = state.canvas;
|
} = state.canvas;
|
||||||
return this.chunkLoader.getHistoricalIndexOfPixel(cx, cy,
|
return this.chunkLoader.getHistoricalIndexOfPixel(cx, cy,
|
||||||
historicalDate, historicalTime);
|
historicalDate, historicalTime, historicalCanvasSize);
|
||||||
}
|
}
|
||||||
return this.chunkLoader.getColorIndexOfPixel(cx, cy);
|
return this.chunkLoader.getColorIndexOfPixel(cx, cy);
|
||||||
}
|
}
|
||||||
|
@ -176,7 +177,6 @@ class Renderer {
|
||||||
) {
|
) {
|
||||||
const {
|
const {
|
||||||
viewscale,
|
viewscale,
|
||||||
view,
|
|
||||||
isHistoricalView,
|
isHistoricalView,
|
||||||
} = state.canvas;
|
} = state.canvas;
|
||||||
pixelNotify.updateScale(viewscale);
|
pixelNotify.updateScale(viewscale);
|
||||||
|
@ -184,9 +184,6 @@ class Renderer {
|
||||||
? 0
|
? 0
|
||||||
: Math.round(Math.log2(viewscale) / 2);
|
: Math.round(Math.log2(viewscale) / 2);
|
||||||
tiledScale = 4 ** tiledScale;
|
tiledScale = 4 ** tiledScale;
|
||||||
const canvasSize = (isHistoricalView)
|
|
||||||
? state.canvas.historicalCanvasSize
|
|
||||||
: state.canvas.canvasSize;
|
|
||||||
const canvasMaxTiledZoom = (isHistoricalView)
|
const canvasMaxTiledZoom = (isHistoricalView)
|
||||||
? this.historicalCanvasMaxTiledZoom
|
? this.historicalCanvasMaxTiledZoom
|
||||||
: this.canvasMaxTiledZoom;
|
: this.canvasMaxTiledZoom;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user