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 // Make sure our backlog never gets too big
clearBufferBacklog(); clearBufferBacklog();
if (G_IS_DEV) { // if (G_IS_DEV) {
const bufferStats = getBufferStats(); // const bufferStats = getBufferStats();
const mbUsed = round1Digit(bufferStats.vramUsage / (1024 * 1024)); // const mbUsed = round1Digit(bufferStats.vramUsage / (1024 * 1024));
logger.log( // logger.log(
"GC: Remove", // "GC: Remove",
(deletedKeys + "").padStart(4), // (deletedKeys + "").padStart(4),
", Remain", // ", Remain",
(totalKeys + "").padStart(4), // (totalKeys + "").padStart(4),
"(", // "(",
(bufferStats.bufferCount + "").padStart(4), // (bufferStats.bufferCount + "").padStart(4),
"total", // "total",
")", // ")",
"(", // "(",
(bufferStats.backlogSize + "").padStart(4), // (bufferStats.backlogSize + "").padStart(4),
"backlog", // "backlog",
")", // ")",
"VRAM:", // "VRAM:",
mbUsed, // mbUsed,
"MB" // "MB"
); // );
} // }
++this.iterationIndex; ++this.iterationIndex;
} }

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

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

Loading…
Cancel
Save