Only render shapes in map overview

pull/683/head
tobspr 4 years ago
parent 607fd15a18
commit 1ec8b4fe28

@ -86,29 +86,29 @@ export class BufferMaintainer {
// Make sure our backlog never gets too big
clearBufferBacklog();
if (G_IS_DEV) {
const bufferStats = getBufferStats();
const mbUsed = round1Digit(bufferStats.vramUsage / (1024 * 1024));
logger.log(
"GC: Remove",
(deletedKeys + "").padStart(4),
", Remain",
(totalKeys + "").padStart(4),
"(",
(bufferStats.bufferCount + "").padStart(4),
"total",
")",
"(",
(bufferStats.backlogSize + "").padStart(4),
"backlog",
")",
"VRAM:",
mbUsed,
"MB"
);
}
// if (G_IS_DEV) {
// const bufferStats = getBufferStats();
// const mbUsed = round1Digit(bufferStats.vramUsage / (1024 * 1024));
// logger.log(
// "GC: Remove",
// (deletedKeys + "").padStart(4),
// ", Remain",
// (totalKeys + "").padStart(4),
// "(",
// (bufferStats.bufferCount + "").padStart(4),
// "total",
// ")",
// "(",
// (bufferStats.backlogSize + "").padStart(4),
// "backlog",
// ")",
// "VRAM:",
// mbUsed,
// "MB"
// );
// }
++this.iterationIndex;
}

@ -15,14 +15,16 @@ export function getDeviceDPI() {
* @returns {number} Smoothed dpi
*/
export function smoothenDpi(dpi) {
if (dpi < 0.02) {
return 0.02;
} else if (dpi < 0.1) {
return round2Digits(dpi);
if (dpi < 0.05) {
return 0.05;
} else if (dpi < 0.2) {
return round2Digits(Math.round(dpi / 0.04) * 0.04);
} else if (dpi < 1) {
return round1Digit(dpi);
} else {
return round1Digit(Math.round(dpi / 0.1) * 0.1);
} else if (dpi < 4) {
return round1Digit(Math.round(dpi / 0.5) * 0.5);
} else {
return 4;
}
}

@ -109,12 +109,12 @@ export class MapChunkView extends MapChunk {
if (this.root.currentLayer === "regular") {
for (let i = 0; i < this.patches.length; ++i) {
const patch = this.patches[i];
const destX = this.x * dims + patch.pos.x * globalConfig.tileSize;
const destY = this.y * dims + patch.pos.y * globalConfig.tileSize;
const diameter = Math.min(80, 30 / parameters.zoomLevel);
patch.item.drawItemCenteredClipped(destX, destY, parameters, diameter);
if (patch.item.getItemType() === "shape") {
const destX = this.x * dims + patch.pos.x * globalConfig.tileSize;
const destY = this.y * dims + patch.pos.y * globalConfig.tileSize;
const diameter = 100 / Math.pow(parameters.zoomLevel, 0.35);
patch.item.drawItemCenteredClipped(destX, destY, parameters, diameter);
}
}
}
}

Loading…
Cancel
Save